From 163869782ed230b2b2b51369e09d63a167f7a310 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Thu, 19 Oct 2023 13:55:07 -0500 Subject: [PATCH] all pylint issues in tests/ --- .pylintrc | 2 +- .../test_completely_bounded_trace_norm.py | 2 +- tests/test_channel_ops/test_dual_channel.py | 4 ++-- tests/test_nonlocal_games/test_xor_game.py | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.pylintrc b/.pylintrc index 0b013203..598784e9 100644 --- a/.pylintrc +++ b/.pylintrc @@ -204,7 +204,7 @@ redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io [FORMAT] # Maximum number of characters on a single line. -max-line-length=100 +max-line-length=120 # Regexp for a line that is allowed to be longer than the limit. ignore-long-lines=^\s*(# )??$ diff --git a/tests/test_channel_metrics/test_completely_bounded_trace_norm.py b/tests/test_channel_metrics/test_completely_bounded_trace_norm.py index 6dadc867..86c920be 100644 --- a/tests/test_channel_metrics/test_completely_bounded_trace_norm.py +++ b/tests/test_channel_metrics/test_completely_bounded_trace_norm.py @@ -16,7 +16,7 @@ def test_cb_trace_norm_unitaries_channel(): """The diamond norm of phi = id- U id U* is the diameter of the smallest circle that contains the eigenvalues of U.""" U = 1 / np.sqrt(2) * np.array([[1, 1], [-1, 1]]) # Hadamard gate phi = kraus_to_choi([[np.eye(2), np.eye(2)], [U, -U]]) - lam, eigv = np.linalg.eig(U) + lam, _ = np.linalg.eig(U) dist = np.abs(lam[:, None] - lam[None, :]) # all to all distance diameter = np.max(dist) np.testing.assert_equal( diff --git a/tests/test_channel_ops/test_dual_channel.py b/tests/test_channel_ops/test_dual_channel.py index 815819e5..5d927ddd 100644 --- a/tests/test_channel_ops/test_dual_channel.py +++ b/tests/test_channel_ops/test_dual_channel.py @@ -75,8 +75,8 @@ def test_dual_channel_choi_dims(): def test_dual_channel_nonsquare_matrix(): """Dual of a channel that transposes 3x2 matrices.""" - choi = swap_operator([2, 3]) - choi_dual = dual_channel(choi, dims=[[3, 2], [2, 3]]) + choi1 = swap_operator([2, 3]) + choi_dual = dual_channel(choi1, dims=[[3, 2], [2, 3]]) expected_choi_dual = np.array( [ [1, 0, 0, 0, 0, 0], diff --git a/tests/test_nonlocal_games/test_xor_game.py b/tests/test_nonlocal_games/test_xor_game.py index 4a5b9231..43c41bc1 100644 --- a/tests/test_nonlocal_games/test_xor_game.py +++ b/tests/test_nonlocal_games/test_xor_game.py @@ -3,7 +3,6 @@ import numpy as np -from toqito.nonlocal_games.nonlocal_game import NonlocalGame from toqito.nonlocal_games.xor_game import XORGame