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

ISA circuit support for latest Runtime #786

Open
woodsp-ibm opened this issue Mar 8, 2024 · 4 comments
Open

ISA circuit support for latest Runtime #786

woodsp-ibm opened this issue Mar 8, 2024 · 4 comments
Assignees
Labels
priority: high type: design 📐 Relevant to code architecture

Comments

@woodsp-ibm
Copy link
Member

woodsp-ibm commented Mar 8, 2024

https://docs.quantum.ibm.com/announcements/product-updates/2024-02-14-qiskit-runtime-primitives-update

beginning 1 March 2024, Qiskit Runtime will require that circuits and observables are transformed to use only instructions supported by the system (referred to as instruction set architecture (ISA) circuits and observables) before being submitted to the primitives

This affects the existing V1 primitves, as supported here, as well as the newly introduced V2 ones which are yet to be supported, see #742

In cases in maybe that the user can already pass a transpiled circuit, in some cases where its two circuits that joined, feature map and ansatz, care would be needed. Observables need to match the layout too. Anyway the situation needs investigation to determine how to proceed.

ML also makes use of Qiskit Algorithms for which there is an open issue too on the same subject qiskit-community/qiskit-algorithms#164 and though I have linked this for reference I think the dependence is more around optimizers and other logic that is independent of the primitives, except for use of the gradients which most likely needs further investigation around whether ISA circuits can be directly used with these, or do they need any alteration.

@woodsp-ibm
Copy link
Member Author

woodsp-ibm commented Mar 11, 2024

Just noting this as it came up. Using tutorial 2 now with a runtime Sampler and QNNCircuit where it needs to be an ISA circuit. When you transpile that to pass it as an ISA circuit one needs to be explicit about input and weights as this logic https://github.com/qiskit-community/qiskit-machine-learning/blob/main/qiskit_machine_learning/neural_networks/sampler_qnn.py#L187-L192 will no longer see it as a QNNCircuit instance and default them appropriately. Also without clbits we should probably think about doing a measure_active() rather than a measure_all().

@oscar-wallis
Copy link
Collaborator

@woodsp-ibm, is the issue here just we need to updates our ML algs to use V2 primitives, being careful with passing inputs and weights? A fairly large overhaul but not much of a challenge, the new documentation makes it seem easy enough.

@woodsp-ibm
Copy link
Member Author

@oscar-wallis No, supporting V2 primitives is a separate thing. For them, and for the current V1 primitives since March, IBM Runtime requires the circuit to be an ISA circuit as input to its primitives and no longer supports logical circuits - ie they must be already transpiled to the target device to be valid. The new V2 primitives need this as well so it needs to be done either way. Note the the V1 primitives in Runtime are already deprecated as of the 0.23 release mid April and they will be removed completely in the not too distant future.

@oscar-wallis
Copy link
Collaborator

oscar-wallis commented May 15, 2024

@woodsp-ibm yes sorry, with updating to V2 I meant also adding the transpiling to ISA circuits. So we need to go through to wherever an alg uses an estimator or sampler like QSVC and make sure we do the added steps of requiring a backend and then transpiling to that backend? Everything specified in the Primitives with transpiling documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high type: design 📐 Relevant to code architecture
Projects
None yet
Development

No branches or pull requests

3 participants