-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update pylint requirement from 3.0.3 to 3.1.0 Updates the requirements on [pylint](https://github.com/pylint-dev/pylint) to permit the latest version. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](pylint-dev/pylint@v3.0.3...v3.1.0) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> * Ruff format * line too long * install latest ruff before ruff format . * temporarily ignore w1404 * Fix W1404: Implicit string concatenation * Update pyproject.toml * add ruff format . to job * remove ruff format . --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
b58f066
commit f3e2ebd
Showing
335 changed files
with
2,638 additions
and
2,055 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
"pytest", | ||
"pytest-cov", | ||
"qiskit", | ||
"scs" | ||
"scs", | ||
] | ||
|
||
setuptools.setup( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Compute the channel fidelity between two quantum channels.""" | ||
|
||
import cvxpy | ||
import numpy as np | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Compute the diamond norm between two quantum channels.""" | ||
|
||
import cvxpy | ||
import numpy as np | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
toqito/channel_metrics/tests/test_completely_bounded_spectral_norm.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,41 @@ | ||
"""Tests for diamond_norm.""" | ||
|
||
import numpy as np | ||
import pytest | ||
|
||
from toqito.channel_metrics import diamond_norm | ||
from toqito.channels import dephasing, depolarizing | ||
|
||
|
||
@pytest.mark.parametrize("test_input1, test_input_2, expected", [ | ||
# The diamond norm of identical channels should yield 0 | ||
(dephasing(2), dephasing(2), 0), | ||
# the diamond norm of different channels | ||
(dephasing(2), depolarizing(2), 1)]) | ||
@pytest.mark.parametrize( | ||
"test_input1, test_input_2, expected", | ||
[ | ||
# The diamond norm of identical channels should yield 0 | ||
(dephasing(2), dephasing(2), 0), | ||
# the diamond norm of different channels | ||
(dephasing(2), depolarizing(2), 1), | ||
], | ||
) | ||
def test_diamond_norm_valid_inputs(test_input1, test_input_2, expected): | ||
"""Test function works as expected for valid inputs.""" | ||
calculated_value = diamond_norm(test_input1, test_input_2) | ||
assert pytest.approx(expected, 1e-3) == calculated_value | ||
|
||
|
||
@pytest.mark.parametrize("test_input1, test_input_2, expected_msg", [ | ||
# Inconsistent dimensions between Choi matrices | ||
(depolarizing(4), dephasing(2), "The Choi matrices provided should be of equal dimension."), | ||
# Non-square inputs for diamond norm | ||
(np.array([[1, 2, 3], [4, 5, 6]]), np.array([[1, 2, 3], [4, 5, 6]]), "The Choi matrix provided must be square.")]) | ||
@pytest.mark.parametrize( | ||
"test_input1, test_input_2, expected_msg", | ||
[ | ||
# Inconsistent dimensions between Choi matrices | ||
(depolarizing(4), dephasing(2), "The Choi matrices provided should be of equal dimension."), | ||
# Non-square inputs for diamond norm | ||
( | ||
np.array([[1, 2, 3], [4, 5, 6]]), | ||
np.array([[1, 2, 3], [4, 5, 6]]), | ||
"The Choi matrix provided must be square.", | ||
), | ||
], | ||
) | ||
def test_diamond_norm_invalid_inputs(test_input1, test_input_2, expected_msg): | ||
"""Test function raises error as expected for invalid inputs.""" | ||
with pytest.raises(ValueError, match = expected_msg): | ||
with pytest.raises(ValueError, match=expected_msg): | ||
diamond_norm(test_input1, test_input_2) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.