Skip to content

Commit

Permalink
Revert to removing blank classical wires in `FlattenRelabelRegistersP…
Browse files Browse the repository at this point in the history
…ass` (#1453)
  • Loading branch information
cqc-alec authored Jun 17, 2024
1 parent fd15f0f commit d5659a1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pytket/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def package(self):
cmake.install()

def requirements(self):
self.requires("tket/1.3.9@tket/stable")
self.requires("tket/1.3.10@tket/stable")
self.requires("tklog/0.3.3@tket/stable")
self.requires("tkrng/0.3.3@tket/stable")
self.requires("tkassert/0.3.4@tket/stable")
Expand Down
8 changes: 8 additions & 0 deletions pytket/docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
=========

Unreleased
----------

Feature:

* Revert keeping of blank classical wires when running
``FlattenRelabelRegistersPass``.

1.29.1 (June 2024)
------------------

Expand Down
10 changes: 1 addition & 9 deletions pytket/tests/predicates_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
Unitary2qBox,
Node,
Qubit,
Bit,
UnitID,
Conditional,
)
Expand Down Expand Up @@ -886,10 +885,7 @@ def test_conditional_phase() -> None:


def test_flatten_relabel_pass() -> None:
c = Circuit(3, 3)
c.add_bit(Bit("d", 0))
c.add_bit(Bit("d", 1))
c.add_c_register("e", 5)
c = Circuit(3)
c.H(1).H(2)
rename_map: RenameUnitsMap = dict()
rename_map[Qubit(0)] = Qubit("a", 4)
Expand All @@ -905,10 +901,6 @@ def test_flatten_relabel_pass() -> None:
assert cu.initial_map[Qubit("a", 4)] == Qubit("a", 4)
assert cu.initial_map[Qubit("b", 7)] == Qubit("a", 1)
assert cu.circuit.qubits == [Qubit("a", 0), Qubit("a", 1)]
assert cu.circuit.n_bits == 10
assert cu.circuit.get_c_register("c").size == 3
assert cu.circuit.get_c_register("d").size == 2
assert cu.circuit.get_c_register("e").size == 5

# test default argument
c = Circuit()
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.9"
version = "1.3.10"
package_type = "library"
license = "Apache 2"
homepage = "https://github.com/CQCL/tket"
Expand Down
2 changes: 1 addition & 1 deletion tket/src/Predicates/PassGenerators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ PassPtr gen_flatten_relabel_registers_pass(const std::string& label) {
Transform t =
Transform([=](Circuit& circuit, std::shared_ptr<unit_bimaps_t> maps) {
unsigned n_qubits = circuit.n_qubits();
circuit.remove_blank_wires(true);
circuit.remove_blank_wires(false);
bool changed = circuit.n_qubits() < n_qubits;
std::map<Qubit, Qubit> relabelling_map;
std::vector<Qubit> all_qubits = circuit.all_qubits();
Expand Down

0 comments on commit d5659a1

Please sign in to comment.