openfermion.transforms.symmetric_ordering

Apply the symmetric ordering to a BosonOperator or QuadOperator.

Main aliases

openfermion.symmetric_ordering, openfermion.transforms.repconversions.symmetric_ordering, openfermion.transforms.repconversions.weyl_ordering.symmetric_ordering

Used in the notebooks

The symmetric ordering is performed by applying McCoy's formula directly to polynomial terms of quadrature operators:

qmpn>(1/2n)sumnr=0Binomial(n,r)qrpmqnr

In this case, Hermiticity cannot be guaranteed - as such, by default term coefficients and identity operators are ignored. However, this behavior can be modified via keyword arguments describe below if necessary.

operator either a BosonOperator or QuadOperator.
ignore_coeff bool

By default, the coefficients for each term are ignored; S(a q^m p^n) = S(q^m p^n), and the returned operator is always Hermitian. If set to False, then instead the coefficients are taken into account; S(q^m p^n) = a S(q^m p^n). In this case, if a is a complex coefficient, it is not guaranteed that the returned operator will be Hermitian.

ignore_identity bool

By default, identity terms are ignore; S(I) = 0. If set to False, then instead S(I) = I.

transformed_operator an operator of the same class as in the input.

The runtime of this method is exponential in the maximum locality of the original operator.