Skip to content

Commit

Permalink
change test
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmoutinho committed Nov 8, 2024
1 parent 4b544d8 commit 3af2c62
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/backends/pyq/test_time_dependent_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from qadence import AbstractBlock, HamEvo, QuantumCircuit, QuantumModel, Register, run


@pytest.mark.parametrize("duration", [0.5, 1.0, 2.0, 5.0])
@pytest.mark.parametrize("duration", [0.5, 1.0, 2.0])
@pytest.mark.parametrize("ode_solver", [SolverType.DP5_SE, SolverType.KRYLOV_SE])
def test_time_dependent_generator(
qadence_generator: AbstractBlock,
Expand All @@ -26,17 +26,17 @@ def test_time_dependent_generator(
n_steps = 500

# simulate with qadence HamEvo using QuantumModel
hamevo = HamEvo(qadence_generator, time_param, duration=duration)
hamevo = HamEvo(qadence_generator, time_param)
reg = Register(2)
circ = QuantumCircuit(reg, hamevo)
model = QuantumModel(circ, configuration={"ode_solver": ode_solver, "n_steps_hevo": n_steps})
state_qadence0 = model.run(values={"x": torch.tensor(feature_param_x)})

state_qadence1 = run(
hamevo,
values={"x": torch.tensor(feature_param_x)},
configuration={"ode_solver": ode_solver, "n_steps_hevo": n_steps},
)
config = {"ode_solver": ode_solver, "n_steps_hevo": n_steps}
values = values = {"x": torch.tensor(feature_param_x), "duration": torch.tensor(duration)}

model = QuantumModel(circ, configuration=config)
state_qadence0 = model.run(values=values)

# simulate with qadence.execution
state_qadence1 = run(hamevo, values=values, configuration=config)

# simulate with qutip
t_points = np.linspace(0, duration, n_steps)
Expand Down

0 comments on commit 3af2c62

Please sign in to comment.