Context: The purity calculation for gaussian state depends on the precision in SF, however, in some cases, this value can be small but the tolerance is not enough small to detect it, hence, the state which should be mixed become a "pure" tag in the gaussian backend calculation.
Description of the Change: This PR fix the calculation from a - b <tol into a/b == 1.0 as the condition.
Benefits:
Possible Drawbacks: I believe that when we set of the calculation in the way a - b <tol, there must be some considerations behind. So it may be not a good solution for all library.
Context: The purity calculation for gaussian state depends on the precision in SF, however, in some cases, this value can be small but the tolerance is not enough small to detect it, hence, the state which should be mixed become a "pure" tag in the gaussian backend calculation.
Description of the Change: This PR fix the calculation from
a - b <tol
intoa/b == 1.0
as the condition.Benefits:
Possible Drawbacks: I believe that when we set of the calculation in the way
a - b <tol
, there must be some considerations behind. So it may be not a good solution for all library.Related GitHub Issues: Issue 745