From da7854cfa4f555d62658a7b1a6d206d429e1c48c Mon Sep 17 00:00:00 2001 From: "J. S. Kottmann" Date: Wed, 20 Mar 2024 14:08:49 +0100 Subject: [PATCH] Update qasm.py --- src/tequila/circuit/qasm.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tequila/circuit/qasm.py b/src/tequila/circuit/qasm.py index 0c68abcf..6076058d 100644 --- a/src/tequila/circuit/qasm.py +++ b/src/tequila/circuit/qasm.py @@ -314,8 +314,11 @@ def parse_command(command: str, custom_gates_map: Dict[str, QCircuit], qregister if name in ("x", "y", "z", "h", "cx", "cy", "cz", "ch"): G = getattr(gates, name.upper()) - control = get_qregister(args[0], qregisters), get_qregister(args[1], qregisters) - target = get_qregister(args[1 if name[0] == 'C' else 0], qregisters) + target = get_qregister(args[0], qregisters) + control = None + if name[0] == c: + control = get_qregister(args[0], qregisters) + target = get_qregister(args[1], qregisters) return G(control=control, target=target) if name in ("ccx", "ccy", "ccz"):