Skip to content

Commit 79a458c

Browse files
authored
⚡ change the default AMO and EO encoding (#309)
## 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 <lukas.burgholzer@jku.at>
1 parent e5c96f2 commit 79a458c

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

include/configuration/Configuration.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ struct Configuration {
5656
std::size_t timeout = 3600000; // 60min timeout
5757

5858
// encoding of at most and exactly one constraints in exact mapper
59-
Encoding encoding = Encoding::Naive;
60-
CommanderGrouping commanderGrouping = CommanderGrouping::Halves;
59+
Encoding encoding = Encoding::Commander;
60+
CommanderGrouping commanderGrouping = CommanderGrouping::Fixed3;
6161

6262
// use qubit subsets in exact mapper
6363
bool useSubsets = true;

mqt/qmap/compile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ def compile( # noqa: A001
6464
use_teleportation: bool = False,
6565
teleportation_fake: bool = False,
6666
teleportation_seed: int = 0,
67-
encoding: str | Encoding = "naive",
68-
commander_grouping: str | CommanderGrouping = "halves",
67+
encoding: str | Encoding = "commander",
68+
commander_grouping: str | CommanderGrouping = "fixed3",
6969
use_bdd: bool = False,
7070
swap_reduction: str | SwapReduction = "coupling_limit",
7171
swap_limit: int = 0,

test/test_exact.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ TEST_F(ExactTest, WCNFNotAvailable) {
431431
using namespace qc::literals;
432432

433433
settings.verbose = false;
434+
settings.encoding = Encoding::Naive;
434435
settings.includeWCNF = true;
435436

436437
auto circ = qc::QuantumComputation(5U);

0 commit comments

Comments
 (0)