Skip to content

Commit

Permalink
feature: add new IonQ Aria-2 target + unit-tests (#507)
Browse files Browse the repository at this point in the history
* feature: add IonQ Aria-2 target

* chore: updated test-recordings

* chore: retriggering microsoft.visualization-pr check since it's stuck
  • Loading branch information
kikomiss authored Sep 12, 2023
1 parent 1672bb9 commit e32c5a4
Show file tree
Hide file tree
Showing 84 changed files with 14,018 additions and 42,992 deletions.
4 changes: 2 additions & 2 deletions azure-quantum/azure/quantum/qiskit/backends/ionq.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def __init__(self, name: str, provider: "AzureQuantumProvider", **kwargs):


class IonQAriaQirBackend(IonQQirBackendBase):
backend_names = ("ionq.qpu.aria-1",)
backend_names = ("ionq.qpu.aria-1", "ionq.qpu.aria-2")

def __init__(self, name: str, provider: "AzureQuantumProvider", **kwargs):
"""Base class for interfacing with an IonQ Aria QPU backend"""
Expand Down Expand Up @@ -316,7 +316,7 @@ def _azure_config(self) -> Dict[str, str]:


class IonQAriaBackend(IonQBackend):
backend_names = ("ionq.qpu.aria-1",)
backend_names = ("ionq.qpu.aria-1", "ionq.qpu.aria-2")

def __init__(self, name: str, provider: "AzureQuantumProvider", **kwargs):
"""Base class for interfacing with an IonQ Aria QPU backend"""
Expand Down
14 changes: 9 additions & 5 deletions azure-quantum/azure/quantum/target/ionq.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,22 @@
COST_1QUBIT_GATE_MAP = {
"ionq.simulator" : 0.0,
"ionq.qpu" : 0.00003,
"ionq.qpu.aria-1" : 0.0002205
"ionq.qpu.aria-1" : 0.0002205,
"ionq.qpu.aria-2" : 0.0002205
}

COST_2QUBIT_GATE_MAP = {
"ionq.simulator" : 0.0,
"ionq.qpu" : 0.0003,
"ionq.qpu.aria-1" : 0.00098
"ionq.qpu.aria-1" : 0.00098,
"ionq.qpu.aria-2" : 0.00098
}

MIN_PRICE_MAP = {
"ionq.simulator" : 0.0,
"ionq.qpu" : 1.0,
"ionq.qpu.aria-1" : 97.5
"ionq.qpu.aria-1" : 97.5,
"ionq.qpu.aria-2" : 97.5
}

def int_to_bitstring(k: int, num_qubits: int, measured_qubit_ids: List[int]):
Expand All @@ -39,7 +42,8 @@ class IonQ(Target):
target_names = (
"ionq.qpu",
"ionq.simulator",
"ionq.qpu.aria-1"
"ionq.qpu.aria-1",
"ionq.qpu.aria-2"
)

def __init__(
Expand Down Expand Up @@ -132,7 +136,7 @@ def estimate_cost(
For the most current pricing details, see
https://docs.microsoft.com/azure/quantum/provider-ionq#pricing
Or find your workspace and view pricing options in the "Provider" tab
or find your workspace and view pricing options in the "Provider" tab
of your workspace: https://aka.ms/aq/myworkspaces
:param circuit: Quantum circuit in IonQ JSON format (for examples,
Expand Down
1,161 changes: 495 additions & 666 deletions azure-quantum/tests/unit/recordings/test_configuration_quantinuum_backends.yaml

Large diffs are not rendered by default.

260 changes: 130 additions & 130 deletions azure-quantum/tests/unit/recordings/test_estimator_batching_job.yaml

Large diffs are not rendered by default.

140 changes: 89 additions & 51 deletions azure-quantum/tests/unit/recordings/test_estimator_failing_job.yaml

Large diffs are not rendered by default.

1,398 changes: 680 additions & 718 deletions azure-quantum/tests/unit/recordings/test_estimator_non_batching_job.yaml

Large diffs are not rendered by default.

169 changes: 65 additions & 104 deletions azure-quantum/tests/unit/recordings/test_estimator_profiling_job.yaml

Large diffs are not rendered by default.

801 changes: 372 additions & 429 deletions azure-quantum/tests/unit/recordings/test_estimator_qiskit_job.yaml

Large diffs are not rendered by default.

172 changes: 68 additions & 104 deletions azure-quantum/tests/unit/recordings/test_job_submit_ionq.yaml

Large diffs are not rendered by default.

196 changes: 61 additions & 135 deletions azure-quantum/tests/unit/recordings/test_job_submit_ionq_100_shots.yaml

Large diffs are not rendered by default.

Large diffs are not rendered by default.

334 changes: 82 additions & 252 deletions azure-quantum/tests/unit/recordings/test_job_submit_quantinuum.yaml

Large diffs are not rendered by default.

316 changes: 112 additions & 204 deletions azure-quantum/tests/unit/recordings/test_job_submit_quantinuum_h2_1e.yaml

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

152 changes: 77 additions & 75 deletions azure-quantum/tests/unit/recordings/test_parametrized_quil.yaml

Large diffs are not rendered by default.

129 changes: 55 additions & 74 deletions azure-quantum/tests/unit/recordings/test_plugins_cirq_get_targets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,95 +53,76 @@ interactions:
uri: https://eastus.quantum.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Quantum/workspaces/myworkspace/providerStatus?api-version=2022-09-12-preview&test-sequence-id=1
response:
body:
string: '{"value": [{"id": "Microsoft", "currentAvailability": "Degraded", "targets":
[{"id": "microsoft.paralleltempering-parameterfree.cpu", "currentAvailability":
"Unavailable", "averageQueueTime": 0, "statusPage": null}, {"id": "microsoft.paralleltempering.cpu",
"currentAvailability": "Unavailable", "averageQueueTime": 0, "statusPage":
null}, {"id": "microsoft.simulatedannealing-parameterfree.cpu", "currentAvailability":
"Unavailable", "averageQueueTime": 0, "statusPage": null}, {"id": "microsoft.simulatedannealing.cpu",
"currentAvailability": "Unavailable", "averageQueueTime": 0, "statusPage":
null}, {"id": "microsoft.tabu-parameterfree.cpu", "currentAvailability": "Unavailable",
"averageQueueTime": 0, "statusPage": null}, {"id": "microsoft.tabu.cpu", "currentAvailability":
"Unavailable", "averageQueueTime": 0, "statusPage": null}, {"id": "microsoft.qmc.cpu",
"currentAvailability": "Unavailable", "averageQueueTime": 0, "statusPage":
null}, {"id": "microsoft.populationannealing.cpu", "currentAvailability":
"Unavailable", "averageQueueTime": 0, "statusPage": null}, {"id": "microsoft.populationannealing-parameterfree.cpu",
"currentAvailability": "Unavailable", "averageQueueTime": 0, "statusPage":
null}, {"id": "microsoft.substochasticmontecarlo.cpu", "currentAvailability":
"Unavailable", "averageQueueTime": 0, "statusPage": null}, {"id": "microsoft.substochasticmontecarlo-parameterfree.cpu",
"currentAvailability": "Unavailable", "averageQueueTime": 0, "statusPage":
null}, {"id": "microsoft.populationannealing-parameterfree.cpu", "currentAvailability":
"Unavailable", "averageQueueTime": 0, "statusPage": null}]}, {"id": "ionq",
"currentAvailability": "Degraded", "targets": [{"id": "ionq.qpu", "currentAvailability":
"Available", "averageQueueTime": 791, "statusPage": "https://status.ionq.co"},
{"id": "ionq.qpu.aria-1", "currentAvailability": "Unavailable", "averageQueueTime":
192312, "statusPage": "https://status.ionq.co"}, {"id": "ionq.simulator",
"currentAvailability": "Available", "averageQueueTime": 23, "statusPage":
"https://status.ionq.co"}]}, {"id": "quantinuum", "currentAvailability": "Degraded",
"targets": [{"id": "quantinuum.qpu.h1-1", "currentAvailability": "Degraded",
"averageQueueTime": 0, "statusPage": "https://www.quantinuum.com/hardware/h1"},
string: '{"value": [{"id": "ionq", "currentAvailability": "Degraded", "targets":
[{"id": "ionq.qpu", "currentAvailability": "Available", "averageQueueTime":
0, "statusPage": "https://status.ionq.co"}, {"id": "ionq.qpu.aria-1", "currentAvailability":
"Unavailable", "averageQueueTime": 755678, "statusPage": "https://status.ionq.co"},
{"id": "ionq.qpu.aria-2", "currentAvailability": "Available", "averageQueueTime":
77908, "statusPage": "https://status.ionq.co"}, {"id": "ionq.simulator", "currentAvailability":
"Available", "averageQueueTime": 991, "statusPage": "https://status.ionq.co"}]},
{"id": "microsoft-qc", "currentAvailability": "Available", "targets": [{"id":
"microsoft.estimator", "currentAvailability": "Available", "averageQueueTime":
0, "statusPage": null}]}, {"id": "pasqal", "currentAvailability": "Available",
"targets": [{"id": "pasqal.sim.emu_free", "currentAvailability": "Available",
"averageQueueTime": 0, "statusPage": "https://pasqal.com"}, {"id": "pasqal.sim.emu_tn",
"currentAvailability": "Available", "averageQueueTime": 0, "statusPage": "https://pasqal.com"},
{"id": "pasqal.qpu.fresnel", "currentAvailability": "Available", "averageQueueTime":
0, "statusPage": "https://pasqal.com"}]}, {"id": "quantinuum", "currentAvailability":
"Degraded", "targets": [{"id": "quantinuum.qpu.h1-1", "currentAvailability":
"Unavailable", "averageQueueTime": 0, "statusPage": "https://www.quantinuum.com/hardware/h1"},
{"id": "quantinuum.sim.h1-1sc", "currentAvailability": "Available", "averageQueueTime":
14, "statusPage": "https://www.quantinuum.com/hardware/h1"}, {"id": "quantinuum.qpu.h1-2",
"currentAvailability": "Degraded", "averageQueueTime": 0, "statusPage": "https://www.quantinuum.com/hardware/h1"},
{"id": "quantinuum.sim.h1-2sc", "currentAvailability": "Available", "averageQueueTime":
0, "statusPage": "https://www.quantinuum.com/hardware/h1"}, {"id": "quantinuum.sim.h1-1e",
"currentAvailability": "Available", "averageQueueTime": 89468, "statusPage":
"https://www.quantinuum.com/hardware/h1"}, {"id": "quantinuum.sim.h1-2e",
"currentAvailability": "Available", "averageQueueTime": 1046, "statusPage":
"https://www.quantinuum.com/hardware/h1"}, {"id": "quantinuum.qpu.h2-1", "currentAvailability":
"Available", "averageQueueTime": 68997, "statusPage": "https://www.quantinuum.com/hardware/h2"},
{"id": "quantinuum.sim.h2-1sc", "currentAvailability": "Available", "averageQueueTime":
1, "statusPage": "https://www.quantinuum.com/hardware/h2"}, {"id": "quantinuum.sim.h2-1e",
"currentAvailability": "Available", "averageQueueTime": 76098, "statusPage":
"https://www.quantinuum.com/hardware/h2"}, {"id": "quantinuum.sim.h1-1sc-preview",
"currentAvailability": "Available", "averageQueueTime": 14, "statusPage":
"https://www.quantinuum.com/hardware/h1"}, {"id": "quantinuum.sim.h1-2sc-preview",
0, "statusPage": "https://www.quantinuum.com/hardware/h1"}, {"id": "quantinuum.qpu.h1-2",
"currentAvailability": "Unavailable", "averageQueueTime": 0, "statusPage":
"https://www.quantinuum.com/hardware/h1"}, {"id": "quantinuum.sim.h1-2sc",
"currentAvailability": "Available", "averageQueueTime": 0, "statusPage": "https://www.quantinuum.com/hardware/h1"},
{"id": "quantinuum.sim.h1-1e", "currentAvailability": "Available", "averageQueueTime":
6, "statusPage": "https://www.quantinuum.com/hardware/h1"}, {"id": "quantinuum.sim.h1-2e",
"currentAvailability": "Available", "averageQueueTime": 6, "statusPage": "https://www.quantinuum.com/hardware/h1"},
{"id": "quantinuum.qpu.h2-1", "currentAvailability": "Unavailable", "averageQueueTime":
0, "statusPage": "https://www.quantinuum.com/hardware/h2"}, {"id": "quantinuum.sim.h2-1sc",
"currentAvailability": "Available", "averageQueueTime": 7, "statusPage": "https://www.quantinuum.com/hardware/h2"},
{"id": "quantinuum.sim.h2-1e", "currentAvailability": "Available", "averageQueueTime":
0, "statusPage": "https://www.quantinuum.com/hardware/h2"}, {"id": "quantinuum.sim.h1-1sc-preview",
"currentAvailability": "Available", "averageQueueTime": 0, "statusPage": "https://www.quantinuum.com/hardware/h1"},
{"id": "quantinuum.sim.h1-2sc-preview", "currentAvailability": "Available",
"averageQueueTime": 0, "statusPage": "https://www.quantinuum.com/hardware/h1"},
{"id": "quantinuum.sim.h1-1e-preview", "currentAvailability": "Available",
"averageQueueTime": 89468, "statusPage": "https://www.quantinuum.com/hardware/h1"},
"averageQueueTime": 6, "statusPage": "https://www.quantinuum.com/hardware/h1"},
{"id": "quantinuum.sim.h1-2e-preview", "currentAvailability": "Available",
"averageQueueTime": 1046, "statusPage": "https://www.quantinuum.com/hardware/h1"},
{"id": "quantinuum.qpu.h1-1-preview", "currentAvailability": "Degraded", "averageQueueTime":
0, "statusPage": "https://www.quantinuum.com/hardware/h1"}, {"id": "quantinuum.qpu.h1-2-preview",
"currentAvailability": "Degraded", "averageQueueTime": 0, "statusPage": "https://www.quantinuum.com/hardware/h1"}]},
"averageQueueTime": 6, "statusPage": "https://www.quantinuum.com/hardware/h1"},
{"id": "quantinuum.qpu.h1-1-preview", "currentAvailability": "Unavailable",
"averageQueueTime": 0, "statusPage": "https://www.quantinuum.com/hardware/h1"},
{"id": "quantinuum.qpu.h1-2-preview", "currentAvailability": "Unavailable",
"averageQueueTime": 0, "statusPage": "https://www.quantinuum.com/hardware/h1"}]},
{"id": "rigetti", "currentAvailability": "Degraded", "targets": [{"id": "rigetti.sim.qvm",
"currentAvailability": "Available", "averageQueueTime": 5, "statusPage": "https://rigetti.statuspage.io/"},
{"id": "rigetti.qpu.aspen-m-2", "currentAvailability": "Unavailable", "averageQueueTime":
0, "statusPage": null}, {"id": "rigetti.qpu.aspen-m-3", "currentAvailability":
"Available", "averageQueueTime": 5, "statusPage": "https://rigetti.statuspage.io/"}]},
{"id": "1qbit", "currentAvailability": "Unavailable", "targets": [{"id": "1qbit.tabu",
"currentAvailability": "Unavailable", "averageQueueTime": 0, "statusPage":
null}, {"id": "1qbit.pathrelinking", "currentAvailability": "Unavailable",
"averageQueueTime": 0, "statusPage": null}, {"id": "1qbit.pticm", "currentAvailability":
"Unavailable", "averageQueueTime": 0, "statusPage": null}]}, {"id": "toshiba",
"currentAvailability": "Available", "targets": [{"id": "toshiba.sbm.ising",
"currentAvailability": "Available", "averageQueueTime": 4, "statusPage": "https://aq-sbm.net/v1/service_monitor/index.html"}]},
{"id": "microsoft-qc", "currentAvailability": "Available", "targets": [{"id":
"microsoft.estimator", "currentAvailability": "Available", "averageQueueTime":
0, "statusPage": null}]}, {"id": "qci", "currentAvailability": "Degraded",
"targets": [{"id": "qci.simulator", "currentAvailability": "Available", "averageQueueTime":
1, "statusPage": "https://quantumcircuits.com"}, {"id": "qci.machine1", "currentAvailability":
"Unavailable", "averageQueueTime": 1, "statusPage": "https://quantumcircuits.com"},
{"id": "qci.simulator.noisy", "currentAvailability": "Available", "averageQueueTime":
0, "statusPage": "https://quantumcircuits.com"}]}, {"id": "Microsoft.Test",
"currentAvailability": "Available", "targets": [{"id": "echo-rigetti", "currentAvailability":
"Available", "averageQueueTime": 1, "statusPage": ""}, {"id": "echo-quantinuum",
{"id": "qci", "currentAvailability": "Degraded", "targets": [{"id": "qci.simulator",
"currentAvailability": "Available", "averageQueueTime": 1, "statusPage": "https://quantumcircuits.com"},
{"id": "qci.machine1", "currentAvailability": "Unavailable", "averageQueueTime":
1, "statusPage": "https://quantumcircuits.com"}, {"id": "qci.simulator.noisy",
"currentAvailability": "Available", "averageQueueTime": 0, "statusPage": "https://quantumcircuits.com"}]},
{"id": "Microsoft.Test", "currentAvailability": "Available", "targets": [{"id":
"echo-rigetti", "currentAvailability": "Available", "averageQueueTime": 1,
"statusPage": ""}, {"id": "echo-quantinuum", "currentAvailability": "Available",
"averageQueueTime": 1, "statusPage": ""}, {"id": "echo-qci", "currentAvailability":
"Available", "averageQueueTime": 1, "statusPage": ""}, {"id": "echo-ionq",
"currentAvailability": "Available", "averageQueueTime": 1, "statusPage": ""},
{"id": "echo-qci", "currentAvailability": "Available", "averageQueueTime":
1, "statusPage": ""}, {"id": "echo-ionq", "currentAvailability": "Available",
"averageQueueTime": 1, "statusPage": ""}, {"id": "sparse-sim-rigetti", "currentAvailability":
"Available", "averageQueueTime": 1, "statusPage": ""}, {"id": "sparse-sim-quantinuum",
{"id": "sparse-sim-rigetti", "currentAvailability": "Available", "averageQueueTime":
1, "statusPage": ""}, {"id": "sparse-sim-quantinuum", "currentAvailability":
"Available", "averageQueueTime": 1, "statusPage": ""}, {"id": "sparse-sim-qci",
"currentAvailability": "Available", "averageQueueTime": 1, "statusPage": ""},
{"id": "sparse-sim-qci", "currentAvailability": "Available", "averageQueueTime":
1, "statusPage": ""}, {"id": "sparse-sim-ionq", "currentAvailability": "Available",
"averageQueueTime": 1, "statusPage": ""}, {"id": "echo-output", "currentAvailability":
"Available", "averageQueueTime": 1, "statusPage": ""}]}], "nextLink": null,
"access_token": "fake_token"}'
{"id": "sparse-sim-ionq", "currentAvailability": "Available", "averageQueueTime":
1, "statusPage": ""}, {"id": "echo-output", "currentAvailability": "Available",
"averageQueueTime": 1, "statusPage": ""}]}], "nextLink": null, "access_token":
"fake_token"}'
headers:
connection:
- keep-alive
content-length:
- '7170'
- '5501'
content-type:
- application/json; charset=utf-8
transfer-encoding:
Expand Down
Loading

0 comments on commit e32c5a4

Please sign in to comment.