I have moved the QubitOperator and QubitTerm class to ProjectQ.
(it is in a private repo as we still don't have all the CLA (but hopefully soon). We will then add it to the public repo.
The new QubitOperator is in src/projecttmp/ops/ hence we can import it same was we will when changing to ProjectQ.
from projectqtemp.ops import QubitOperator
Todo:
[ ] Change FermiLib to use this new QubitOperator
Changes
Only one class instead of two which gets rid of the problem of QubitTerm + QubitTerm -> QubitOperator
removed a lot of magic methods as explicit is better than implicit for internal code. But users can still have + , *, etc.
numpy.isscalar("0.5") == True therefore I only allow isinstance(x, (float, int, complex)) this works for all numpy types except numpy.float128 but this is not a supported type from numpy
removed == but use isclose() instead as we are dealing with a floating point object
added __itruediv__ and __truediv__ to make it Python 3 compatible
I have moved the
QubitOperator
andQubitTerm
class to ProjectQ. (it is in a private repo as we still don't have all the CLA (but hopefully soon). We will then add it to the public repo.The new
QubitOperator
is insrc/projecttmp/ops/
hence we can import it same was we will when changing to ProjectQ.from projectqtemp.ops import QubitOperator
Todo:
Changes
+
,*
, etc.numpy.isscalar("0.5") == True
therefore I only allowisinstance(x, (float, int, complex))
this works for all numpy types exceptnumpy.float128
but this is not a supported type from numpy==
but useisclose()
instead as we are dealing with a floating point object__itruediv__
and__truediv__
to make it Python 3 compatible