Skip to content

Commit

Permalink
Fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
mlazzarin committed Dec 21, 2021
1 parent 539ab3a commit 1394fd9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/qibo/tests/test_core_gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit 1394fd9

Please sign in to comment.