Skip to content

Commit 6dd413c

Browse files
david-plweinbe58
andauthored
Update apply signature for single qubits
Co-authored-by: Phillip Weinberg <[email protected]>
1 parent c77c205 commit 6dd413c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/bloqade/pyqrack/squin/runtime.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ def get_method_name(self, adjoint: bool, control: bool) -> str:
4848

4949
return method_name + self.method_name
5050

51-
def apply(self, *qubits: PyQrackQubit, adjoint: bool = False) -> None:
51+
def apply(self, qubits: PyQrackQubit, adjoint: bool = False) -> None:
52+
if not qubit.is_active():
53+
return
5254
method_name = self.get_method_name(adjoint=adjoint, control=False)
53-
getattr(qubits[0].sim_reg, method_name)(qubits[0].addr)
55+
getattr(qubits.sim_reg, method_name)(qubits.addr)
5456

5557
def control_apply(self, *qubits: PyQrackQubit, adjoint: bool = False) -> None:
5658
ctrls = [qbit.addr for qbit in qubits[:-1]]

0 commit comments

Comments
 (0)