-
Notifications
You must be signed in to change notification settings - Fork 100
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
Why the expect value of Hamiltonian is different from qiskit? #299
Comments
Hi, can you post a small example on what exactly you're doing, that might help. |
https://github.com/YangD5014/Tequlia_issue/blob/main/tequila_issue.ipynb |
thanks for the example. Next reply will take a bit longer ;-) |
I think I found the problem: it is not the qasm import, this works fine. Qiskit is using the following oder in the second quantized Hamiltonian: first N/2 qubits are the spin-up orbitals, second N/2 qubits are the spin-down orbitals. Tequila is using the same ordering as openfermion: Even qubits are spin-up, odd qubits are spin-down. Good news is: You can use the ordering that qiskit uses also in Tequila mol = tq.Molecule(geometry=..., basis_set=..., transformation="ReorderedJordanWigner") same goes with "ReorderedBravyiKitaev" etc (the upper-cases are just for readability) |
It is so clear! And it is indeed working,thank you! |
When I have a tequila circuit transformed from openqasm, I do try the circuit(no uncertain parameters) as ansatz,and I get the expectation value of Hamiltonian,but get far different value compared to qiskit.
Please correct me if I do misuse the tequila API.
The text was updated successfully, but these errors were encountered: