View source on GitHub |
Fix some orbitals to be occupied and others unoccupied.
openfermion.transforms.freeze_orbitals(
fermion_operator, occupied, unoccupied=None, prune=True
)
Removes all operators acting on the specified orbitals, and optionally renumbers the remaining orbitals to eliminate unused indices. The sign of each term is modified according to the ladder operator anti-commutation relations in order to preserve the expectation value of the operator.