From f76f247f664a879193d19c5b142aa70223b9fcd0 Mon Sep 17 00:00:00 2001 From: Lawson Graham <45542987+LawsonGraham@users.noreply.github.com> Date: Tue, 6 Aug 2024 15:30:38 -0700 Subject: [PATCH] undo basis gates changes done in #625 (#632) --- .../azure/quantum/qiskit/backends/ionq.py | 28 ++++--------------- .../quantum/qiskit/backends/microsoft.py | 7 +++-- .../azure/quantum/qiskit/backends/qci.py | 8 ++++-- .../quantum/qiskit/backends/quantinuum.py | 4 ++- .../azure/quantum/qiskit/backends/rigetti.py | 8 ++++-- 5 files changed, 23 insertions(+), 32 deletions(-) diff --git a/azure-quantum/azure/quantum/qiskit/backends/ionq.py b/azure-quantum/azure/quantum/qiskit/backends/ionq.py index 19509577a..b8c9a1679 100644 --- a/azure-quantum/azure/quantum/qiskit/backends/ionq.py +++ b/azure-quantum/azure/quantum/qiskit/backends/ionq.py @@ -20,6 +20,7 @@ from qiskit.providers import Options, Provider from qiskit_ionq.helpers import ( + ionq_basis_gates, GATESET_MAP, qiskit_circ_to_ionq_circ, ) @@ -51,25 +52,6 @@ _IONQ_SHOTS_INPUT_PARAM_NAME = "shots" _DEFAULT_SHOTS_COUNT = 500 -IONQ_BASIS_GATES = [ - "measure", - "m", - "cx", - "cz", - "h", - "reset", - "rx", - "ry", - "rz", - "s", - "swap", - "t", - "x", - "y", - "z", - "id", -] - class IonQQirBackendBase(AzureQirBackend): """Base class for interfacing with an IonQ QIR backend""" @@ -133,7 +115,7 @@ def __init__(self, name: str, provider: "AzureQuantumProvider", **kwargs): "local": False, "coupling_map": None, "description": "IonQ simulator on Azure Quantum", - "basis_gates": IONQ_BASIS_GATES, + "basis_gates": ionq_basis_gates, "memory": False, "n_qubits": 29, "conditional": False, @@ -165,7 +147,7 @@ def __init__(self, name: str, provider: "AzureQuantumProvider", **kwargs): "local": False, "coupling_map": None, "description": "IonQ QPU on Azure Quantum", - "basis_gates": IONQ_BASIS_GATES, + "basis_gates": ionq_basis_gates, "memory": False, "n_qubits": 11, "conditional": False, @@ -197,7 +179,7 @@ def __init__(self, name: str, provider: "AzureQuantumProvider", **kwargs): "local": False, "coupling_map": None, "description": "IonQ Aria QPU on Azure Quantum", - "basis_gates": IONQ_BASIS_GATES, + "basis_gates": ionq_basis_gates, "memory": False, "n_qubits": 23, "conditional": False, @@ -229,7 +211,7 @@ def __init__(self, name: str, provider: "AzureQuantumProvider", **kwargs): "local": False, "coupling_map": None, "description": "IonQ Forte QPU on Azure Quantum", - "basis_gates": IONQ_BASIS_GATES, + "basis_gates": ionq_basis_gates, "memory": False, "n_qubits": 35, "conditional": False, diff --git a/azure-quantum/azure/quantum/qiskit/backends/microsoft.py b/azure-quantum/azure/quantum/qiskit/backends/microsoft.py index 8ee00d56a..c8b4b45bf 100644 --- a/azure-quantum/azure/quantum/qiskit/backends/microsoft.py +++ b/azure-quantum/azure/quantum/qiskit/backends/microsoft.py @@ -12,9 +12,10 @@ from qiskit.providers.models import BackendConfiguration from qiskit.providers import Options, Provider -MICROSOFT_BASIS_GATES = [ +QIR_BASIS_GATES = [ "measure", "m", + "ccx", "cx", "cz", "h", @@ -23,8 +24,10 @@ "ry", "rz", "s", + "sdg", "swap", "t", + "tdg", "x", "y", "z", @@ -90,7 +93,7 @@ def __init__(self, name: str, provider: "AzureQuantumProvider", **kwargs): "local": False, "coupling_map": None, "description": "Resource estimator on Azure Quantum", - "basis_gates": MICROSOFT_BASIS_GATES, + "basis_gates": QIR_BASIS_GATES, "memory": False, "n_qubits": 0xFFFFFFFFFFFFFFFF, # NOTE: maximum 64-bit unsigned value "conditional": True, diff --git a/azure-quantum/azure/quantum/qiskit/backends/qci.py b/azure-quantum/azure/quantum/qiskit/backends/qci.py index 1df4633a5..99225e45b 100644 --- a/azure-quantum/azure/quantum/qiskit/backends/qci.py +++ b/azure-quantum/azure/quantum/qiskit/backends/qci.py @@ -15,7 +15,7 @@ from qiskit.providers.models import BackendConfiguration from qiskit.providers import Options, Provider -QCI_BASIS_GATES = [ +QIR_BASIS_GATES = [ "measure", "m", "barrier", @@ -27,8 +27,10 @@ "ry", "rz", "s", + "sdg", "swap", "t", + "tdg", "x", "y", "z", @@ -108,7 +110,7 @@ def __init__(self, name: str, provider: "AzureQuantumProvider", **kwargs): "local": False, "coupling_map": None, "description": "QCI simulator on Azure Quantum", - "basis_gates": QCI_BASIS_GATES, + "basis_gates": QIR_BASIS_GATES, "memory": False, "n_qubits": 29, "conditional": True, @@ -140,7 +142,7 @@ def __init__(self, name: str, provider: "AzureQuantumProvider", **kwargs): "local": False, "coupling_map": None, "description": "QCI QPU on Azure Quantum", - "basis_gates": QCI_BASIS_GATES, + "basis_gates": QIR_BASIS_GATES, "memory": False, "n_qubits": 11, "conditional": True, diff --git a/azure-quantum/azure/quantum/qiskit/backends/quantinuum.py b/azure-quantum/azure/quantum/qiskit/backends/quantinuum.py index fc08d5c8a..a6e3a79e6 100644 --- a/azure-quantum/azure/quantum/qiskit/backends/quantinuum.py +++ b/azure-quantum/azure/quantum/qiskit/backends/quantinuum.py @@ -40,10 +40,12 @@ "cx", "cz", "s", + "sdg", "t", + "tdg", "v", "vdg", - "rzz", + "zz", "measure", "reset", ] diff --git a/azure-quantum/azure/quantum/qiskit/backends/rigetti.py b/azure-quantum/azure/quantum/qiskit/backends/rigetti.py index 3300d8f9c..7f5784bf5 100644 --- a/azure-quantum/azure/quantum/qiskit/backends/rigetti.py +++ b/azure-quantum/azure/quantum/qiskit/backends/rigetti.py @@ -12,7 +12,7 @@ from qiskit.providers.models import BackendConfiguration from qiskit.providers import Options, Provider -RIGETTI_BASIS_GATES = [ +QIR_BASIS_GATES = [ "measure", "m", "cx", @@ -23,7 +23,9 @@ "ry", "rz", "s", + "sdg," "t", + "tdg", "x", "y", "z", @@ -83,7 +85,7 @@ def __init__(self, name: str, provider: "AzureQuantumProvider", **kwargs): "local": False, "coupling_map": None, "description": "Rigetti simulator on Azure Quantum", - "basis_gates": RIGETTI_BASIS_GATES, + "basis_gates": QIR_BASIS_GATES, "memory": True, "n_qubits": RigettiTarget.num_qubits(name), "conditional": False, @@ -115,7 +117,7 @@ def __init__(self, name: str, provider: "AzureQuantumProvider", **kwargs): "local": False, "coupling_map": None, "description": "Rigetti QPU on Azure Quantum", - "basis_gates": RIGETTI_BASIS_GATES, + "basis_gates": QIR_BASIS_GATES, "memory": True, "n_qubits": RigettiTarget.num_qubits(name), "conditional": False,