Skip to content

Commit

Permalink
updating tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivansh20128 committed Nov 16, 2024
1 parent 326b11c commit 86d5dfe
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions toqito/channel_ops/tests/test_complementary_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,26 @@
from toqito.channel_ops import complementary_channel

# Define test cases for complementary map
kraus_1 = np.array([[0.5, 0], [0, 0]])
kraus_2 = np.array([[0, 0.5], [0, 0]])
kraus_3 = np.array([[0, 0], [0.5, 0]])
kraus_4 = np.array([[0, 0], [0, 0.5]])
kraus_1 = np.array([[1, 0], [0, 0]]) / np.sqrt(2)
kraus_2 = np.array([[0, 1], [0, 0]]) / np.sqrt(2)
kraus_3 = np.array([[0, 0], [1, 0]]) / np.sqrt(2)
kraus_4 = np.array([[0, 0], [0, 1]]) / np.sqrt(2)

# Expected results for the complementary map
expected_res_comp = [
np.array([[0.5, 0], [0, 0.5], [0, 0], [0, 0]]),
np.array([[0, 0], [0, 0], [0.5, 0], [0, 0.5]]),
np.array([[1, 0], [0, 1], [0, 0], [0, 0]]) / np.sqrt(2),
np.array([[0, 0], [0, 0], [1, 0], [0, 1]]) / np.sqrt(2),
]

# Higher-dimensional Kraus operators (3x3)
kraus_5 = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 0]]) / np.sqrt(2)
kraus_6 = np.array([[0, 0, 1], [0, 0, 0], [1, 0, 0]]) / np.sqrt(2)
kraus_5 = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) / np.sqrt(3)
kraus_6 = np.array([[0, 1, 0], [0, 0, 1], [1, 0, 0]]) / np.sqrt(3)
kraus_7 = np.array([[0, 0, 1], [1, 0, 0], [0, 1, 0]]) / np.sqrt(3)

expected_res_comp_high_dim = [
np.array([[1, 0, 0], [0, 0, 1]]) / np.sqrt(2),
np.array([[0, 1, 0], [0, 0, 0]]) / np.sqrt(2),
np.array([[0, 0, 0], [1, 0, 0]]) / np.sqrt(2),
np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) / np.sqrt(3),
np.array([[0, 1, 0], [0, 0, 1], [1, 0, 0]]) / np.sqrt(3),
np.array([[0, 0, 1], [1, 0, 0], [0, 1, 0]]) / np.sqrt(3),
]

# Single Kraus operator (edge case)
Expand Down

0 comments on commit 86d5dfe

Please sign in to comment.