Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only update index map when needed #1697

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.13.0")
self.requires("tkassert/0.3.4@tket/stable")
self.requires("tket/1.3.50@tket/stable")
self.requires("tket/1.3.51@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.50"
version = "1.3.51"
package_type = "library"
license = "Apache 2"
homepage = "https://github.com/CQCL/tket"
Expand Down
3 changes: 3 additions & 0 deletions tket/include/tket/Transformations/CliffordReductionPass.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ class CliffordReductionPass {
/** The circuit under transformation */
Circuit ˆ

/** Topological-order-respecting map from circuit vertices to integers */
IndexMap im;

/** Table of potential transports of 2qb interactions through the circuit */
interaction_table_t itable;

Expand Down
3 changes: 2 additions & 1 deletion tket/src/Transformations/CliffordReductionPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ std::optional<InteractionMatch> CliffordReductionPass::search_back_for_match(
point[0] = rip0;
point[1] = rip1;
std::map<Edge, RevInteractionPoint> point_lookup;
IndexMap im = circ.index_map();

// interactions met when commuting back; point lists are in causal order of
// circuit:
Expand Down Expand Up @@ -350,6 +349,7 @@ void CliffordReductionPass::process_new_interaction(const Vertex &inter) {
break;
}
}
im = circ.index_map();
success = true;
} else {
std::vector<std::optional<Edge>> outs = circ.get_linear_out_edges(v);
Expand Down Expand Up @@ -645,6 +645,7 @@ CliffordReductionPass::valid_insertion_point(

CliffordReductionPass::CliffordReductionPass(Circuit &c, bool swaps)
: circ(c),
im(c.index_map()),
itable(),
v_to_depth(),
success(false),
Expand Down
Loading