openfermion.utils.map_two_pdm_to_one_pdm

Contract a 2-RDM to a 1-RDM

tpdm numpy.ndarray

The 2-RDM as a 4-index tensor. Indices follow the internal convention of tpdm[p, q, r, s] == \(a_{p}^{\dagger}a_{q}^{\dagger}a_{r}a_{s}\).

particle_number float

number of particles in the system

opdm numpy.ndarray

The 1-RDM contracted from the tpdm.