diff --git a/circuit_knitting/cutting/cut_finding/cutting_actions.py b/circuit_knitting/cutting/cut_finding/cutting_actions.py index bfa9afe58..450f35ed3 100644 --- a/circuit_knitting/cutting/cut_finding/cutting_actions.py +++ b/circuit_knitting/cutting/cut_finding/cutting_actions.py @@ -417,7 +417,7 @@ def next_state_primitive( new_state.bell_pairs.append((r2, rnew_2)) new_state.gamma_UB *= 16 - new_state.add_action(self, gate_spec, ((1, w1, rnew_1), (2, w2, rnew_2))) + new_state.add_action(self, gate_spec, (1, w1, rnew_1), (2, w2, rnew_2)) return [new_state] diff --git a/circuit_knitting/cutting/cut_finding/disjoint_subcircuits_state.py b/circuit_knitting/cutting/cut_finding/disjoint_subcircuits_state.py index e1712647e..38fa96a11 100644 --- a/circuit_knitting/cutting/cut_finding/disjoint_subcircuits_state.py +++ b/circuit_knitting/cutting/cut_finding/disjoint_subcircuits_state.py @@ -37,7 +37,7 @@ class Action(NamedTuple): action: DisjointSearchAction gate_spec: GateSpec - args: list + args: list | tuple class GateCutLocation(NamedTuple): @@ -430,12 +430,12 @@ def add_action( self, action_obj: DisjointSearchAction, gate_spec: GateSpec, - args: tuple | None = None, + *args: tuple, ) -> None: """Append the specified action to the list of search-space actions that have been performed.""" if action_obj.get_name() is not None: self.actions = cast(list, self.actions) - self.actions.append(Action(action_obj, gate_spec, [args])) + self.actions.append(Action(action_obj, gate_spec, args)) def get_search_level(self) -> int: """Return the search level.""" diff --git a/test/cutting/cut_finding/test_best_first_search.py b/test/cutting/cut_finding/test_best_first_search.py index 9fa5c5afd..6cf50f8f4 100644 --- a/test/cutting/cut_finding/test_best_first_search.py +++ b/test/cutting/cut_finding/test_best_first_search.py @@ -114,7 +114,7 @@ def test_best_first_search(test_circuit: SimpleGateList): gate=CircuitElement(name="cx", params=[], qubits=[3, 4], gamma=3), cut_constraints=None, ), - [((1, 3), (2, 4))], + (((1, 3), (2, 4)),), ), ( GateSpec( @@ -122,7 +122,7 @@ def test_best_first_search(test_circuit: SimpleGateList): gate=CircuitElement(name="cx", params=[], qubits=[3, 5], gamma=3), cut_constraints=None, ), - [((1, 3), (2, 5))], + (((1, 3), (2, 5)),), ), ( GateSpec( @@ -130,7 +130,7 @@ def test_best_first_search(test_circuit: SimpleGateList): gate=CircuitElement(name="cx", params=[], qubits=[3, 6], gamma=3), cut_constraints=None, ), - [((1, 3), (2, 6))], + (((1, 3), (2, 6)),), ), ]