-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Labels
good first issueGood for newcomersGood for newcomers
Milestone
Description
This issue qualifies for UnitaryDESIGN 2026!
Context
Given two pure quantum states
Task
- Add a method to the class
graphix.sim.statevec.Statevecwhich allows to compute the fidelity of two quantum states.
Hint: Check :func: graphix.sim.statevec.Statevec.evolve_single.
- Add a method
isclosewhich evaluates if two quantum states are equal up to a phase. This method should compute the fidelity and check if it's equal to 1 within certain relative and absolute tolerance.
Hint: Check math.isclose.
-
Unit tests in graphix often resort to a simulation of two equivalent patterns (obtained with different methods), and the assertion that they represent the same unitary.
Use the method implemented in 2) to replaceassert np.abs(np.dot(state.flatten().conjugate(), state2.flatten())) == pytest.approx(1)and similar statements in the test suite.
Note: New methods should have the appropriate docstrings and unit tests.
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers