Closed timmysilv closed 1 year ago
All modified lines are covered by tests :white_check_mark:
Comparison is base (
8447c11
) 99.14% compared to head (e87a73d
) 99.14%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@mudit2812 Christina is looking into that in another PR
codecov is failing because of a fallback mechanism that should probably be stated as no-cover, and perhaps will be hit less frequently with this numpy bump? I saw the issue locally in both scenarios so I'm not sure what's going on...
more context: computing expval with a density matrix sometimes fails some validation in cirq code here and that raises a ValueError. In those cases, we default to QubitDevice expval. It seems like this test was the only one doing that, and it doesn't seem to default with the latest numpy.
updated the description with an EDIT, pls check it out
With numpy <1.25, the probs are identical (
[0.49999967, 0.49999967]
) before dotting with the eigenvalues so the result is exactly zero. With numpy >=1.25, they are not ([0.49999964, 0.49999958]
). This slight change is very mysterious to me, but I have confirmed that it appears at this line. The inputtedself.circuit
is identical, and the outputted result is reliably off. Each value in the state is off by up to 3e-8, and I don't know why (they aren't totally random rounding errors because the difference between old and new states are numbers like1.00000e-8
or9.3400000e-9
).My solution for now is to allow an atol of 5e-8.
EDIT: I've removed the expval override since it's not covered anymore. It was needed with the old numpy - should I pin the minimum, or keep the expval and put a no-cover comment on it?
EDIT 2: I decided to keep the override so we can still use old numpy without issues, and I added a test that forces use of the old one for codecov happiness