Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for toqito/channel_metrics/channel_fidelity.py : 82-97, 79->82 #231

Closed
2 tasks done
Tracked by #217
purva-thakre opened this issue Nov 13, 2023 · 0 comments · Fixed by #232
Closed
2 tasks done
Tracked by #217

Add tests for toqito/channel_metrics/channel_fidelity.py : 82-97, 79->82 #231

purva-thakre opened this issue Nov 13, 2023 · 0 comments · Fixed by #232
Assignees

Comments

@purva-thakre
Copy link
Collaborator

purva-thakre commented Nov 13, 2023

Failing tests (if commented out)

FAILED test_channel_fidelity.py::test_channel_fidelity_same_channel - TypeError: Failed to convert argument 'x' of partial_trace to a PICOS constant.
FAILED test_channel_fidelity.py::test_channel_fidelity_different_channel - TypeError: Failed to convert argument 'x' of partial_trace to a PICOS constant.

# def test_channel_fidelity_same_channel():
# """The fidelity of identical channels should yield 1."""
# choi_1 = dephasing(4)
# choi_2 = dephasing(4)
# np.testing.assert_equal(np.isclose(channel_fidelity(choi_1, choi_2), 1, atol=1e-3), True)
# def test_channel_fidelity_different_channel():
# """Calculate the channel fidelity of different channels."""
# choi_1 = dephasing(4)
# choi_2 = depolarizing(4)
# np.testing.assert_equal(np.isclose(channel_fidelity(choi_1, choi_2), 1 / 2, atol=1e-3), True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant