Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikandreasseitz committed Feb 8, 2024
1 parent 633eb11 commit 9c30efa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_analog.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

from jax import Array
import jax.numpy as jnp
import pytest

Expand All @@ -23,10 +24,11 @@
("10", 1 / jnp.sqrt(2) * jnp.array([1, 0, 0, -1])),
],
)
def test_bell_states(init_state, final_state):
state = product_state(init_state)
def test_bell_states(bitstring:str, final_state: Array):
state = product_state(bitstring)
time_evo = jnp.array([1.0], dtype=jnp.complex128)
state = apply_gate(state, HamiltonianEvolution((0, 1)), {"hamiltonian": Hbase, "time_evolution": time_evo})
assert jnp.isclose(state, final_state)


# @pytest.mark.xfail
Expand Down

0 comments on commit 9c30efa

Please sign in to comment.