From 8c03bd858002780dba121aa418e4cc4a85e47b33 Mon Sep 17 00:00:00 2001 From: xuxusheng Date: Fri, 23 Feb 2024 11:04:15 +0800 Subject: [PATCH] fix hiqasm --- mindquantum/io/qasm/hiqasm.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mindquantum/io/qasm/hiqasm.py b/mindquantum/io/qasm/hiqasm.py index 67f1945f4..1e6a14cca 100644 --- a/mindquantum/io/qasm/hiqasm.py +++ b/mindquantum/io/qasm/hiqasm.py @@ -430,6 +430,12 @@ def _trans_v01(self, cmds, n_qubits): # pylint: disable=too-many-branches self.circuit.ry(*_extr_parameter(cmd), qubit[-1], qubit[:2]) elif cmd.startswith('CCRZ '): self.circuit.rz(*_extr_parameter(cmd), qubit[-1], qubit[:2]) + elif cmd.startswith("XX"): + self.circuit.rxx(*_extr_parameter(cmd), qubit[-2:], qubit[:-2]) + elif cmd.startswith("YY"): + self.circuit.ryy(*_extr_parameter(cmd), qubit[-2:], qubit[:-2]) + elif cmd.startswith("ZZ"): + self.circuit.rzz(*_extr_parameter(cmd), qubit[-2:], qubit[:-2]) elif cmd.startswith('MEASURE '): qubit = _find_qubit_id(cmd) if qubit: