Skip to content

Qiskit Circuit Library deprecations #931

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

Closed
woodsp-ibm opened this issue May 21, 2025 · 0 comments · Fixed by #945
Closed

Qiskit Circuit Library deprecations #931

woodsp-ibm opened this issue May 21, 2025 · 0 comments · Fixed by #945
Labels
dependencies 🔗 Involves external dependency libraries
Milestone

Comments

@woodsp-ibm
Copy link
Member

woodsp-ibm commented May 21, 2025

In issue #897 around Qiskit 2.0 support I wrote a comment that there are also circuit library deprecations that should be addressed #897 (comment)

Qiskit ML both uses library circuits like this and also has its own library with BlueprintCircuit based circuits (QNNCircuit and RawFeatureVector). Now BlueprintCircuit is not yet deprecated (is expected to be) but classes in Qiskit derived from this that are used here, such as ZZFeatureMap have already been deprecated since Qiskit 1.3 and their replacement is a function creating an equivalent circuit. Logically it makes sense to do the same with circuit library instances in ML. Now I will note that an aspect of BlueprintCircuit was it allowed a circuit template/design to be specified but without knowing the number of qubits at that point. I.e you might have a high level application input that gets mapped down and without running the mapping the number is not known, but nevertheless an appropriate circuit template for the problem can still be chosen with the circuit being actually built later when known. Now I do not think that aspect is (much) used in ML here the functions require the number of qubits to be given so the circuit is created but I think this should therefore not be an issue in general.

So this has two aspects;

  1. Rework ML code/test/tutorials etc using BlueprintCircuit based Qiskit circuit library classes, such as ZZFeatureMap etc, to use the replacement functions.
  2. Update the ML circuit library classes, and their usage here, similarly.

I will note that this is a place where the number of qubits is attempted to be set and an error raised if it can't be

self._feature_map.num_qubits = x_vec.shape[1]
I guess this code will just raise an error going forwards if there is a size mismatch and not attempt to set num_qubits since that setter, for a plain circuit, will not be there anymore, There may be other places too I did not look in depth.

@edoaltamura edoaltamura added this to the v.0.9.0 milestone May 22, 2025
@edoaltamura edoaltamura added the dependencies 🔗 Involves external dependency libraries label May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies 🔗 Involves external dependency libraries
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants