Assume $|i\rangle,i\in[1,m]$ is a set of states, like the Fock states for Fermions. The question is how to compute the quantity,$\langle i |H|j\rangle,i,j\in[1,m]$, in qiskit. The $H$ here is the qubit form Hamiltonian of some molecule obtained by the Jordan-Wigner transformation.
Asked
Active
Viewed 93 times
4
-
You're looking for the matrix elements of $H$ in the basis $|i⟩$. Depending on what $|i⟩$ is, you can probably do so without qiskit. (Indeed, getting the matrix elements of $H$ is a starting point for chemistry calculations with qiskit!) – jecado Oct 19 '21 at 16:19
1 Answers
1
As mentioned in a comment, there are many times where you might think you want to do this but actually there may be a more direct classical approach (eg. doing a single-body basis transformation of your Hamiltonian's coefficients).
But, sometimes you might need to do this quantum-ly. This paper discusses one way, which requires twice as many qubits but is otherwise pretty efficient: https://arxiv.org/abs/1909.09114
Essentially you prepare |i⟩ and |j⟩ on two different registers and perform a modified Hadamard test.

jecado
- 1,116
- 5
- 18