View source on GitHub |
Apply the symmetric ordering to a BosonOperator or QuadOperator.
openfermion.transforms.symmetric_ordering(
operator, ignore_coeff=True, ignore_identity=True
)
Used in the notebooks
Used in the tutorials |
---|
The symmetric ordering is performed by applying McCoy's formula directly to polynomial terms of quadrature operators:
q^m p^n -> (1/ 2^n) sum_{r=0}^{n} Binomial(n, r) q^r p^m q^{n-r}
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.
Returns | |
---|---|
transformed_operator
|
an operator of the same class as in the input. |
Warning | |
---|---|
The runtime of this method is exponential in the maximum locality of the original operator. |