-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
HHL.solve() doesn't use specified quantum_instance. #8735
Comments
@anedumla Any comment on this one. @ahehn-nv I will note that as from the upcoming release of Terra, in early October, HHL will be deprecated and later removed from Terra https://github.com/Qiskit/qiskit-terra/blob/bcec9a314c68d9412a89904701d45491a68a12c0/qiskit/algorithms/linear_solvers/hhl.py#L112-L114 The tutorial will have to be amended accordingly too. |
@woodsp-ibm it must be a leftover from an older version of HHL and the part with the quantum instance was not updated - my bad. I think one of the reasons I did not notice is that we are not really using it on real hardware, which is the reason it is being deprecated. At the moment I am working on moving it to the research repo - is there something else that needs to be amended in the tutorial other than changing the imports from |
I did not know that the algorithm would be moved over - as you see from the deprecation notice we are referring to the textbook. But that uses this algo as part of it so maybe that will be updated to use what you are putting on qiskit-research and the deprecation message can stay referring to the textbook via which people will see it on qiskit-research? Are you also updating the HHL to use primitives when you relocate it? QuantumInstance is planned for deprecation/removal - the other algorithms remaining here are all being refactored over to use primitives for this upcoming release (0.22). The original algorithm using QuantumInstance are planned to be deprecated in 0.23 (at present they are marked pending deprecation and will work alongside the primitive based ones for one release before being deprecated) |
Actually turns out that there is some pendant discussion as to which repo it should be moved, so will have to wait for that decision before updating the textbook. Regarding the primitives - I was not aware QuantumInstace was going to be deprecated too, thanks for the notice. Will update that too once we decide where to put it. |
@anedumla As HHL is deprecated here and you have the code in another repository linked from the textbook what to do with the issues here. I don't think there is any intent of altering the code here to potentially address any of these since its now deprecated. Do you want to take note of these and maybe create issues in the other repository. At some point these will be closed as not planned. So with this issue in the list too (first one), the ones relevant to HHL I can find are |
Environment
What is happening?
HHL.solve()
in qiskit/algorithms/linear_solvers/hhl.py constructs a quantum circuit qc, stores it in solution.state and callsHHL._calculate_norm(self, qc)
.This function performs an evaluation of the quantum circuit "qc" using qiskit's built-in StateVector simulator and does not use the
quantum_instance
provided to the constructor of hhl:https://github.com/Qiskit/qiskit-terra/blob/070b9e214718b413f3d2f1142ffdc07d1d750c91/qiskit/algorithms/linear_solvers/hhl.py#L238
Is this intentional?
The tutorial https://qiskit.org/textbook/ch-applications/hhl_tutorial.html shows the following example at the end of section 4A
suggesting that
quantum_instance
allows the use of qiskit-aer inHHL.solve()
.Additional information:
hhl._calculate_norm(self, qc)
boils down to an evaluation viahttps://github.com/Qiskit/qiskit-terra/blob/main/qiskit/opflow/state_fns/circuit_state_fn.py#L258
in
CircuitStateFn.to_matrix()
:How can we reproduce the issue?
Script based on the tutorial https://qiskit.org/textbook/ch-applications/hhl_tutorial.html :
What should happen?
HHL should use the backend (e.g., qiskit-aer simulator) passed to the HHL constructor for the circuit evaluation when HHL.solve() is called.
Any suggestions?
No response
The text was updated successfully, but these errors were encountered: