OpenFermion
OpenFermion copied to clipboard
== for SymbolicOperator and other classes should be exact, not approximate, equality
Using ==
for exact equality matches its semantics in every other case I can think of. I realize that I actually advocated for changing it, but in hindsight I think that was a big mistake.
Affected classes:
- SymbolicOperator
- MajoranaOperator
- PolynomialTensor
We can either:
- Leave
__eq__
unimplemented. - Make it mean that the terms dictionaries have the same keys, which are mapped to the exact same values.
I lean towards (2).
Do we have a sense of how ==
is currently used? How much of an impact to users would it be to remove it? I usually think if something is ambiguous, you should force the user to specify, i.e. (1) leave unimplemented.
In any event, I think this has been the behavior for some time so we should go through a deprecation cycle