Skip to content

Comments

Generic Qiskit Backend#722

Open
ScottCarda-MS wants to merge 7 commits intomainfrom
sccarda/GenericQiskitBackend
Open

Generic Qiskit Backend#722
ScottCarda-MS wants to merge 7 commits intomainfrom
sccarda/GenericQiskitBackend

Conversation

@ScottCarda-MS
Copy link
Contributor

@ScottCarda-MS ScottCarda-MS commented Feb 17, 2026

This PR adds a generic QIR backend for Qiskit submission to Azure. This backend will wrap around all available targets and make available all targets that do not otherwise have specifically defined Qiskit backends.
I also found that I needed to address an issue I was encountering where the job metadata being submitted was not fully stringified.

@ScottCarda-MS
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ScottCarda-MS ScottCarda-MS marked this pull request as ready for review February 17, 2026 19:07
@ScottCarda-MS ScottCarda-MS requested a review from a team as a code owner February 17, 2026 19:07
from azure.quantum.qiskit import AzureQuantumProvider


_DEFAULT_SHOTS_COUNT = 500
Copy link
Contributor

Choose a reason for hiding this comment

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

Where did this number come from? I tried looking in the backend base and the default was None.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All of the other backends use 500 as their default shot count, so it seemed appropriate to follow suit here.

Comment on lines +77 to +78
# Default to the most conservative QIR profile; users can override per-run via
# `target_profile=` in backend.run(...).
Copy link
Contributor

Choose a reason for hiding this comment

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

How do users know this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe you are referring to users' ability to set the target profile via target_profile= in backend.run(...). I believe we are currently working on improving our python API documentation, but since this is a preexisting option, I would expect our API documentation to include this.

Copy link
Contributor

Choose a reason for hiding this comment

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

The difference is that the default profile for backends always matched is capabilities. In this case the opposite is true. We don't know its caps and they don't necessarily match.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, you were asking about how users will know that the generic backends will default to the base profile. I'm not sure there is a specific way to do this, other than perhaps in the doc string for the generic backend class.
An idea is to dynamically set the target_profile in the options after Qiskit's initialization (done during our init) to a target_profile based on the target being wrapped.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Though that idea would still have the target_profile here in this _default_options class method set to Base, as we can't use instance specific data here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated to take the target profile from the wrapped target's status. It will set the target_profile in the backend's __init__() method, after Qiskit runs its constructor. _default_options() remains unchanged though. Let me know if you see an issue with this approach.

@ScottCarda-MS ScottCarda-MS force-pushed the sccarda/GenericQiskitBackend branch from 38a28d4 to 19c08a2 Compare February 18, 2026 18:31
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.

2 participants