From a391e9a484e636c2d448e1ace3d416ff9a982f02 Mon Sep 17 00:00:00 2001 From: Matti Sarjala Date: Thu, 14 May 2026 16:21:03 +0300 Subject: [PATCH] Document InteractionOperator Hermitian assumptions --- .../ops/representations/interaction_operator.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/openfermion/ops/representations/interaction_operator.py b/src/openfermion/ops/representations/interaction_operator.py index e5330e7bf..e78806f30 100644 --- a/src/openfermion/ops/representations/interaction_operator.py +++ b/src/openfermion/ops/representations/interaction_operator.py @@ -29,10 +29,17 @@ class InteractionOperator(PolynomialTensor): conserve particle number and spin. The most common examples of data that will use this structure are molecular Hamiltonians. In principle, everything stored in this class could also be represented using the more - general FermionOperator class. However, this class is able to exploit - specific properties of how fermions interact to enable more numerically - efficient manipulation of the data. Note that the operators stored in this - class take the form: + general FermionOperator class. + + This representation is intended for Hermitian interaction Hamiltonians, + such as molecular electronic-structure Hamiltonians. It is not a + general-purpose container for arbitrary non-Hermitian fermionic operators; + use FermionOperator for those cases. Transform routines specialized for + InteractionOperator may rely on these Hermitian structure assumptions. + + However, this class is able to exploit specific properties of how fermions + interact to enable more numerically efficient manipulation of the data. Note + that the operators stored in this class take the form: $$ \text{constant} + \sum_{p, q} h_{p, q} a^\dagger_p a_q +