OpenFermion icon indicating copy to clipboard operation
OpenFermion copied to clipboard

Replace parity=±1 flag with bosonic=True/False flag

Open kevinsung opened this issue 7 years ago • 7 comments

For instance, in number_operator. I think a True/False flag is much more intuitive and pythonic. @josh146 @babbush

kevinsung avatar Sep 13 '18 15:09 kevinsung

That makes sense! I can't quite recall my original thinking, maybe I chose a numeric parity flag just in case (at some point in the future) OpenFermion decided to implement something more exotic, like anyons?

josh146 avatar Sep 13 '18 17:09 josh146

@kevinsung what is the status of this issue? I can make a quick pull request if it is not already waiting for a merge

josh146 avatar Oct 04 '18 13:10 josh146

Please, go ahead.

kevinsung avatar Oct 04 '18 17:10 kevinsung

I believe this is changed. number_operator input line is number_operator(i, coefficient=1., particle_hole_symmetry=False) @kevinsung should this be closed?

ncrubin avatar Oct 17 '20 18:10 ncrubin

@ncrubin The definition of number_operator is not what you said; it's actually https://github.com/quantumlib/OpenFermion/blob/1997ea6042285339cec58c12c33a903b9ec97a30/src/openfermion/hamiltonians/special_operators.py#L273

This issue has not been fixed.

kevinsung avatar Oct 19 '20 14:10 kevinsung

@kevinsung LOL there are a bunch of number_operator functions. Apparently I pasted the one you and Bryan wrote a couple of years ago. https://github.com/quantumlib/OpenFermion/commit/4c0df2e1e9cf641683259eba4d2736eea34da1f7

ncrubin avatar Oct 19 '20 23:10 ncrubin

Oh, it looks like that one should be marked private, since it was defined for use in the file that contains it (and not exported).

kevinsung avatar Oct 20 '20 13:10 kevinsung