From c15dd0383d2b796ffefcd0ec0b1d9d1b49ecd1e7 Mon Sep 17 00:00:00 2001 From: Fionn Malone Date: Mon, 31 Jul 2023 15:45:52 -0700 Subject: [PATCH] Fix typo and add more helpful assertion message. (#6221) --- cirq-ft/cirq_ft/infra/gate_with_registers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cirq-ft/cirq_ft/infra/gate_with_registers.py b/cirq-ft/cirq_ft/infra/gate_with_registers.py index 04fb9e88ee7..c65d3578902 100644 --- a/cirq-ft/cirq_ft/infra/gate_with_registers.py +++ b/cirq-ft/cirq_ft/infra/gate_with_registers.py @@ -122,7 +122,9 @@ def merge_qubits( ) -> List[cirq.Qid]: ret: List[cirq.Qid] = [] for reg in self: - assert reg.name in qubit_regs, "All qubit registers must pe present" + assert ( + reg.name in qubit_regs + ), f"All qubit registers must be present. {reg.name} not in qubit_regs" qubits = qubit_regs[reg.name] qubits = np.array([qubits] if isinstance(qubits, cirq.Qid) else qubits) assert (