Skip to content

Commit

Permalink
⚡ change the default AMO and EO encoding (#309)
Browse files Browse the repository at this point in the history
## Description

This PR changes the default for the encoding of at-most-one and
exactly-one constraints used in the exact mapping approach.
For some (unknown) reason, the default was still using the `naive`
encoding although the commander encoding is superior in practically
every aspect.
This should improve the out-of-the-box performance when using the exact
mapping approach across the board.

## Checklist:

<!---
This checklist serves as a reminder of a couple of things that ensure
your pull request will be merged swiftly.
-->

- [x] The pull request only contains commits that are related to it.
- [x] I have added appropriate tests and documentation.
- [x] I have made sure that all CI jobs on GitHub pass.
- [x] The pull request introduces no new warnings and follows the
project's style guidelines.

Signed-off-by: Lukas Burgholzer <[email protected]>
  • Loading branch information
burgholzer authored May 10, 2023
1 parent e5c96f2 commit 79a458c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/configuration/Configuration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ struct Configuration {
std::size_t timeout = 3600000; // 60min timeout

// encoding of at most and exactly one constraints in exact mapper
Encoding encoding = Encoding::Naive;
CommanderGrouping commanderGrouping = CommanderGrouping::Halves;
Encoding encoding = Encoding::Commander;
CommanderGrouping commanderGrouping = CommanderGrouping::Fixed3;

// use qubit subsets in exact mapper
bool useSubsets = true;
Expand Down
4 changes: 2 additions & 2 deletions mqt/qmap/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def compile( # noqa: A001
use_teleportation: bool = False,
teleportation_fake: bool = False,
teleportation_seed: int = 0,
encoding: str | Encoding = "naive",
commander_grouping: str | CommanderGrouping = "halves",
encoding: str | Encoding = "commander",
commander_grouping: str | CommanderGrouping = "fixed3",
use_bdd: bool = False,
swap_reduction: str | SwapReduction = "coupling_limit",
swap_limit: int = 0,
Expand Down
1 change: 1 addition & 0 deletions test/test_exact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ TEST_F(ExactTest, WCNFNotAvailable) {
using namespace qc::literals;

settings.verbose = false;
settings.encoding = Encoding::Naive;
settings.includeWCNF = true;

auto circ = qc::QuantumComputation(5U);
Expand Down

0 comments on commit 79a458c

Please sign in to comment.