Skip to content
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

Update IonQBackend to handle circuit lists of size one #201

Merged
merged 4 commits into from
Dec 21, 2021

Conversation

jplewa
Copy link
Contributor

@jplewa jplewa commented Dec 17, 2021

closes #200

Qiskit's BackendV1 supports lists of circuits in its run method. This isn't implemented in azure-quantum and qiskit-ionq, which means that passing a list results in confusing exceptions. A while ago, qiskit-ionq added some changes that make it possible to handle circuit lists of length 1 and also added more explicit error messages (see qiskit-community/qiskit-ionq#71). They also have an issue for adding multi-circuit experiment support in the future (see qiskit-community/qiskit-ionq#70).

I believe it would make sense to do the same in azure-quantum, because currently some of Qiskit's features are not usable. I reported this issue in #200.

To make Qiskit's features such as MaximumLikelihoodAmplitudeEstimation usable, azure-quantum would actually need to learn how to handle multi-circuit experiments, but with this PR we can at least make AmplitudeEstimation, IterativeAmplitudeEstimation, and FasterAmplitudeEstimation usable, since they pass single-element circuit lists to the run method.

EDIT: With this PR, every amplitude estimation method from Qiskit should start working.

@ghost
Copy link

ghost commented Dec 17, 2021

CLA assistant check
All CLA requirements met.

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@guenp
Copy link
Contributor

guenp commented Dec 20, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@jplewa
Copy link
Contributor Author

jplewa commented Dec 20, 2021

To make Qiskit's features such as MaximumLikelihoodAmplitudeEstimation usable, azure-quantum would actually need to learn how to handle multi-circuit experiments, but with this PR we can at least make AmplitudeEstimation, IterativeAmplitudeEstimation, and FasterAmplitudeEstimation usable, since they pass single-element circuit lists to the run method.

I re-verified the claim I'd made about MaximumLikelihoodAmplitudeEstimation. This actually isn't true! Once this PR is merged, MLAE should work due to the code changes Terra introducted in Qiskit/qiskit#6391. There's a clever bit of code that splits circuit lists into one-element batches if the backend requires that (which azure-quantum does).

obraz

Copy link
Contributor

@guenp guenp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jplewa for fixing this issue and adding tests as well! It looks good to me but before we merge to main we also want to support this on the Honeywell backend, i.e. in HoneywellBackend.run.

azure-quantum/azure/quantum/qiskit/backends/ionq.py Outdated Show resolved Hide resolved
jplewa and others added 2 commits December 21, 2021 11:13
@jplewa jplewa requested a review from guenp December 21, 2021 14:42
@guenp
Copy link
Contributor

guenp commented Dec 21, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@guenp guenp merged commit ae51aca into microsoft:main Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to use Qiskit features such as AmplitudeEstimation
2 participants