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.

  • $\begingroup$ 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!) $\endgroup$
    – jecado
    Oct 19 at 16:19

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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.