From 6270d248492be7ec64d0b5f8dbda427904870017 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 15 Oct 2023 08:58:21 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/test_gates_channels.py | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/tests/test_gates_channels.py b/tests/test_gates_channels.py index 2a9a8ba743..d6511f83a5 100644 --- a/tests/test_gates_channels.py +++ b/tests/test_gates_channels.py @@ -94,20 +94,30 @@ def test_kraus_channel(backend, pauli_order): channel = gates.KrausChannel(0, [a_1, a_2]) backend.assert_allclose( - float(backend.calculate_norm_density_matrix(channel.to_liouville(backend=backend) - test_superop, order=2)) + float( + backend.calculate_norm_density_matrix( + channel.to_liouville(backend=backend) - test_superop, order=2 + ) + ) < PRECISION_TOL, True, ) backend.assert_allclose( - float(backend.calculate_norm_density_matrix(channel.to_choi(backend=backend) - test_choi, order=2)) + float( + backend.calculate_norm_density_matrix( + channel.to_choi(backend=backend) - test_choi, order=2 + ) + ) < PRECISION_TOL, True, ) backend.assert_allclose( - float(backend.calculate_norm( - channel.to_pauli_liouville(pauli_order=pauli_order, backend=backend) - - test_pauli - )) + float( + backend.calculate_norm( + channel.to_pauli_liouville(pauli_order=pauli_order, backend=backend) + - test_pauli + ) + ) < PRECISION_TOL, True, ) @@ -212,7 +222,11 @@ def test_pauli_noise_channel(backend, pauli_order): liouville = gates.PauliNoiseChannel(0, list(zip(basis, pnp))).to_pauli_liouville( normalize=True, pauli_order=pauli_order, backend=backend ) - norm = float(backend.calculate_norm_density_matrix(backend.to_numpy(liouville) - test_representation, order=2)) + norm = float( + backend.calculate_norm_density_matrix( + backend.to_numpy(liouville) - test_representation, order=2 + ) + ) assert norm < PRECISION_TOL @@ -341,7 +355,11 @@ def test_thermal_relaxation_channel(backend, t_1, t_2, time, excpop): target_state = backend.cast(target_state, dtype=target_state.dtype) backend.assert_allclose( - float(backend.calculate_norm_density_matrix(final_state - target_state, order=2)) < PRECISION_TOL, True + float( + backend.calculate_norm_density_matrix(final_state - target_state, order=2) + ) + < PRECISION_TOL, + True, )