Skip to content

Commit

Permalink
Remove gate-set predicates from DecomposeSwapsToCXs (#1599)
Browse files Browse the repository at this point in the history
  • Loading branch information
cqc-alec authored Oct 1, 2024
1 parent f1c1cf2 commit d975867
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pytket/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def requirements(self):
self.requires("pybind11_json/0.2.14")
self.requires("symengine/0.12.0")
self.requires("tkassert/0.3.4@tket/stable")
self.requires("tket/1.3.30@tket/stable")
self.requires("tket/1.3.31@tket/stable")
self.requires("tklog/0.3.3@tket/stable")
self.requires("tkrng/0.3.3@tket/stable")
self.requires("tktokenswap/0.3.9@tket/stable")
Expand Down
2 changes: 1 addition & 1 deletion tket/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

class TketConan(ConanFile):
name = "tket"
version = "1.3.30"
version = "1.3.31"
package_type = "library"
license = "Apache 2"
homepage = "https://github.com/CQCL/tket"
Expand Down
13 changes: 1 addition & 12 deletions tket/src/Predicates/PassGenerators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -775,23 +775,12 @@ PassPtr gen_decompose_routing_gates_to_cxs_pass(
Transforms::decompose_BRIDGE_to_CX() >>
Transforms::remove_redundancies();
if (directed) {
OpTypeSet out_optypes{all_single_qubit_types()};
out_optypes.insert(OpType::CX);
OpTypeSet in_optypes = out_optypes;
in_optypes.insert(OpType::SWAP);
in_optypes.insert(OpType::BRIDGE);
in_optypes.insert(OpType::Barrier);
PredicatePtr twoqbpred = std::make_shared<MaxTwoQubitGatesPredicate>();
PredicatePtr connected = std::make_shared<ConnectivityPredicate>(arc);
PredicatePtr directedpred = std::make_shared<DirectednessPredicate>(arc);
PredicatePtr ingates = std::make_shared<GateSetPredicate>(in_optypes);
PredicatePtr outgates = std::make_shared<GateSetPredicate>(out_optypes);
precons = {
CompilationUnit::make_type_pair(connected),
CompilationUnit::make_type_pair(ingates)};
precons = {CompilationUnit::make_type_pair(connected)};
s_postcons = {
CompilationUnit::make_type_pair(directedpred),
CompilationUnit::make_type_pair(outgates),
CompilationUnit::make_type_pair(twoqbpred)};
t = t >> Transforms::decompose_CX_directed(arc) >>
Transforms::remove_redundancies();
Expand Down

0 comments on commit d975867

Please sign in to comment.