From 1394fd9c0bb73c7bcab52ca8b3ddf129318b8a7a Mon Sep 17 00:00:00 2001 From: Marco Lazzarin <48728634+mlazzarin@users.noreply.github.com> Date: Tue, 21 Dec 2021 10:13:19 +0400 Subject: [PATCH] Fix type error --- src/qibo/tests/test_core_gates.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qibo/tests/test_core_gates.py b/src/qibo/tests/test_core_gates.py index 31627d1dba..58890ab19b 100644 --- a/src/qibo/tests/test_core_gates.py +++ b/src/qibo/tests/test_core_gates.py @@ -67,27 +67,27 @@ def test_z(backend): def test_s(backend): final_state = apply_gates([gates.H(0), gates.H(1), gates.S(1)], nqubits=2) - target_state = np.array([0.5, 0.5j, 0.5, 0.5j], dtype=final_state.dtype) + target_state = np.array([0.5, 0.5j, 0.5, 0.5j]) K.assert_allclose(final_state, target_state) def test_sdg(backend): final_state = apply_gates([gates.H(0), gates.H(1), gates.SDG(1)], nqubits=2) - target_state = np.array([0.5, -0.5j, 0.5, -0.5j], dtype=final_state.dtype) + target_state = np.array([0.5, -0.5j, 0.5, -0.5j]) K.assert_allclose(final_state, target_state) def test_t(backend): final_state = apply_gates([gates.H(0), gates.H(1), gates.T(1)], nqubits=2) target_state = np.array([0.5, (1 + 1j) / np.sqrt(8), - 0.5, (1 + 1j) / np.sqrt(8)], dtype=final_state.dtype) + 0.5, (1 + 1j) / np.sqrt(8)]) K.assert_allclose(final_state, target_state) def test_tdg(backend): final_state = apply_gates([gates.H(0), gates.H(1), gates.TDG(1)], nqubits=2) target_state = np.array([0.5, (1 - 1j) / np.sqrt(8), - 0.5, (1 - 1j) / np.sqrt(8)], dtype=final_state.dtype) + 0.5, (1 - 1j) / np.sqrt(8)]) K.assert_allclose(final_state, target_state)