qml.qchem.hf_state¶
- hf_state(electrons, orbitals, basis='occupation_number')[source]¶
Generate the Hartree-Fock statevector with respect to a chosen basis.
The many-particle wave function in the Hartree-Fock (HF) approximation is a Slater determinant. In Fock space, a Slater determinant for \(N\) electrons is represented by the occupation-number vector:
\[\begin{split}\vert {\bf n} \rangle = \vert n_1, n_2, \dots, n_\mathrm{orbs} \rangle, n_i = \left\lbrace \begin{array}{ll} 1 & i \leq N \\ 0 & i > N \end{array} \right.,\end{split}\]where \(n_i\) indicates the occupation of the \(i\)-th orbital.
The Hartree-Fock state can also be generated in the parity basis, where each qubit stores the parity of the spin orbital, and in the Bravyi-Kitaev basis, where a qubit \(j\) stores the occupation state of orbital \(j\) if \(j\) is even and stores partial sum of the occupation state of a set of orbitals of indices less than \(j\) if \(j\) is odd [Tranter et al. Int. J. Quantum Chem. 115, 1431 (2015)].
- Parameters
electrons (int) – Number of electrons. If an active space is defined, this is the number of active electrons.
orbitals (int) – Number of spin orbitals. If an active space is defined, this is the number of active spin-orbitals.
basis (string) – Basis in which the HF state is represented. Options are
occupation_number
,parity
andbravyi_kitaev
.
- Returns
NumPy array containing the vector \(\vert {\bf n} \rangle\)
- Return type
array
Example
>>> state = hf_state(2, 6) >>> print(state) [1 1 0 0 0 0]
>>> state = hf_state(2, 6, basis="parity") >>> print(state) [1 0 0 0 0 0]
>>> state = hf_state(2, 6, basis="bravyi_kitaev") >>> print(state) [1 0 0 0 0 0]