# What are the rules that map the second-quantized fermionic Hamiltonian into spin-form in OpenFermion?

We can use OpenFermion to get the molecular Hamiltonian in the form of:
$$H = \sum_{pq} h_{pq} a_p^\dagger a_q + \frac12 \sum_{pqrs} h_{pqrs} a_p^\dagger a_q^\dagger a_r a_s$$ and we can also use the Jordan-Wigner transformation to get the spin Hamiltonian.

So in the molecular Hamiltonian such as the $$\require{mhchem}\ce{H2}$$ molecule we don't add any occupied or active indices limitation, there is a four-qubit Hamiltonian. What does every qubit represent?

You are correct.

There is a 1-1 mapping between the standard "molecular Born-Oppenheimer Hamiltonian" that you wrote down in 2nd quantized form, and the equivalent Jordan-Wigner spin Hamiltonian. That mapping is actually quite simple:

$$\Large{a_j \iff \mathbf{1}^{\otimes {j-1}}\otimes \sigma^{+}\otimes \sigma ^ {z\otimes {N-j-1}}}$$

$$\Large{a_j^{\dagger} \iff \mathbf{1}^{\otimes {j-1}}\otimes \sigma^{-}\otimes \sigma ^{z\otimes {N-j-1}}}$$

By turning each $$a$$ and $$a^\dagger$$ into an equivalent string of Pauli matrices, we don't add any occupied or active indices (which is exactly what you said).

The number of terms in the Hamiltonian you wrote down, will be exactly the number of terms in the Jordan-Wigner form.

The reason why $$\require{mhchem}\ce{H2}$$ has a 4-qubit Jordan-Wigner Hamiltonian in most quantum computing papers, is because they typically use the STO-3G basis set, which has exactly 4 spin orbitals.

• Hi, Hastings. Welcome to Quantum Computing SE! Please don't use screenshots of mathematical expressions. Use MathJax instead. Cf. Why are images of text, code and mathematical expressions discouraged?. I've edited it on your behalf, this time. – Sanchayan Dutta Mar 30 '19 at 8:52
• Thank you very much ! Once we have got the 2nd Hamiltonian, the qubit is decided itself. – 刘环宇 Apr 10 '19 at 12:39
• Also thank you for your re-edit for me – 刘环宇 Apr 10 '19 at 12:40