Skip to content

Update IonQBackend to handle circuit lists of size one #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions azure-quantum/azure/quantum/qiskit/backends/honeywell.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
##
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, Union, List
from azure.quantum.version import __version__
from azure.quantum.qiskit.job import AzureQuantumJob

Expand Down Expand Up @@ -56,14 +56,21 @@


class HoneywellBackend(Backend):
"""Base class for interfacing with an Honeywell backend in Azure Quantum"""
"""Base class for interfacing with a Honeywell backend in Azure Quantum"""

@classmethod
def _default_options(cls):
return Options(count=500)

def run(self, circuit: QuantumCircuit, **kwargs):
"""Submits the given circuit for execution on an Honeywell target."""
def run(self, circuit: Union[QuantumCircuit, List[QuantumCircuit]], **kwargs):
"""Submits the given circuit for execution on a Honeywell target."""
# Some Qiskit features require passing lists of circuits, so unpack those here.
# We currently only support single-experiment jobs.
if isinstance(circuit, (list, tuple)):
if len(circuit) > 1:
raise NotImplementedError("Multi-experiment jobs are not supported!")
circuit = circuit[0]

# If the circuit was created using qiskit.assemble,
# disassemble into QASM here
if isinstance(circuit, QasmQobj) or isinstance(circuit, Qobj):
Expand Down
7 changes: 7 additions & 0 deletions azure-quantum/azure/quantum/qiskit/backends/ionq.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ def _job_metadata(self, circuit, meas_map):

def run(self, circuit, **kwargs):
"""Submits the given circuit to run on an IonQ target."""
# Some Qiskit features require passing lists of circuits, so unpack those here.
# We currently only support single-experiment jobs.
if isinstance(circuit, (list, tuple)):
if len(circuit) > 1:
raise NotImplementedError("Multi-experiment jobs are not supported!")
circuit = circuit[0]

# If the circuit was created using qiskit.assemble,
# disassemble into QASM here
if isinstance(circuit, QasmQobj) or isinstance(circuit, Qobj):
Expand Down
Loading