Closed tomohiro-soejima closed 1 year ago
I'm sorry that my response is very lazy.
With statevector_simulator
or BasicAer.get_backend("qasm_simulator")
, the above program does not work correctly with the current qiskit (though behavior of aer_simulator_density_matrix
looks unexpected). In addition, operator flow is now deprecated. Please create a new issue if we encounter the same issue with the latest API.
Thank you for your response!
This is the same as https://github.com/Qiskit/qiskit/issues/1587, but I realized
qiskit-aer
might be the right place to post it instead ofqiskit
. Please feel free to close either of these.Informations
3.8.13
What is the current behavior?
When running VQE for the two spin Heisenberg model with the Hamiltonian
H = -(X^X) - (Y^Y) - (Z^Z)
, whose ground state energy is-1
. However, when I use a custom ansatz and run VQE withdensity_matrix
backend, VQE reports an energy of-3
, which is lower than the ground state energy.I attach the circuit diagram of the ansatz below:![image](https://user-images.githubusercontent.com/29153822/183784133-f7faaaa5-a129-4ca8-a985-0c38d5e20688.png)
Note that this is a rather pathological ansatz, in that the final state is independent of the parameter
theta
. Perhaps that is a cause of the problem?Steps to reproduce the problem
Here is the MWE to reproduce the problem:
This prints out the following:
What is the expected behavior?
VQE finds the energy of
-1
, which is the energy of the state00
.Suggested solutions
If we uncomment the final line of the MWE (
statevector_simulator
computation) and run it, it prints the following result and runtime warning messages:This seems to signal there is a divide by zero error lurking around. Perhaps what is happening with the
density_matrix
calculation is some kind of silent divide by zero error?