Add fidelity and isclose methods to Statevec#433
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #433 +/- ##
=======================================
Coverage 88.73% 88.74%
=======================================
Files 44 44
Lines 6303 6308 +5
=======================================
+ Hits 5593 5598 +5
Misses 710 710 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
emlynsg
left a comment
There was a problem hiding this comment.
Great work, thank you very much.
We at TeamGraphix have a 2 approval policy, so when a second maintainer approves this PR we are happy to merge it and close the issue with you allocated.
@emlynsg |
matulni
left a comment
There was a problem hiding this comment.
Hi @CodeMaverick2, thanks for your contribution and welcome to the project!
PR looks good, I made a couple of small comments and I'll be happy to approve (and assign you the issue) once they've been addressed. Please, don't forget to update the CHANGELOG and resolve any conflicts arising from recent merges.
Thanks!
cec6272 to
4cb7535
Compare
Before submitting, please check the following:
nox)ruffCONTRIBUTING.mdfor more detailsThen, please fill in below:
Context (if applicable):
np.abs(np.dot(state.flatten().conjugate(), state2.flatten())) == pytest.approx(1)in ~68 places.Description of the change:
Statevec.fidelity(other)computing |⟨ψ₁|ψ₂⟩|² andStatevec.isclose(other)checking equality up to global phaseiscloseRelated issue:
Closes #386