4.8. Constructing a qubit Hamiltonian operator with Qiskit Nature
This section shows how to construct a qubit Hamiltonian operator with Qiskit Nature for the hydrogen molecule and the lithium hydride molecule.
We define the fermion_to_qubit()
function to convert a fermionic operator to a qubit operator, which has the following input parameters:
f_op
, a fermionic operator obtained as explained in Section 4.6, Constructing a fermionic Hamiltonian with Qiskit Naturemapper
, either"Jordan-Wigner"
or"Parity"
or"Bravyi-Kitaev"
truncate
, an integer to truncate the display of the Pauli list, which can be very large; set to20
items by defaulttwo_qubit_reduction
, Boolean, by defaultFalse
, that determines whether to carry out two-qubit reduction when possiblez2symmetry_reduction
, by defaultNone
, that indicates whether a Z2 symmetry reduction should be applied to resulting qubit operators that are computed based on mathematical symmetries...