From 6559c7ff02c54eac09f4bf9aa823358493ea86e4 Mon Sep 17 00:00:00 2001 From: Renato Mello Date: Fri, 20 Sep 2024 10:18:53 +0400 Subject: [PATCH] fix test --- tests/test_quantum_info_operations.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/test_quantum_info_operations.py b/tests/test_quantum_info_operations.py index 75ab6f225a..3d97f1f63a 100644 --- a/tests/test_quantum_info_operations.py +++ b/tests/test_quantum_info_operations.py @@ -122,10 +122,11 @@ def test_matrix_power(backend, power): if isinstance(power, str): with pytest.raises(TypeError): - return matrix_power(state, power, backend) + test = matrix_power(state, power, backend) + else: + power = matrix_power(state, power, backend) - power = matrix_power(state, power, backend) - - backend.assert_allclose( - float(backend.np.real(backend.np.trace(power))), purity(state, backend=backend) - ) + backend.assert_allclose( + float(backend.np.real(backend.np.trace(power))), + purity(state, backend=backend), + )