Skip to content

Commit

Permalink
Seed non-deterministic TestMeasurementTransforms test (#1200)
Browse files Browse the repository at this point in the history
**Context:** We noticed a non-deterministic failing pytest,
`TestMeasurementTransforms.test_measurement_from_samples_single_measurement_analytic`. We can fix the non-deterministic failure by seeding the qjit-ed circuit.

**Description of the Change:** Replace `@qjit` decorator with
`@qjit(seed=37)`.
  • Loading branch information
joeycarter authored Oct 10, 2024
1 parent bcf7023 commit 5f3d1d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/test/pytest/test_measurement_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ def test_measurement_from_samples_single_measurement_analytic(

dev = qml.device("lightning.qubit", wires=4, shots=shots)

@qml.qjit
@qml.qjit(seed=37)
@partial(measurements_from_samples, device_wires=dev.wires)
@qml.qnode(dev)
def circuit(theta: float):
Expand Down

0 comments on commit 5f3d1d3

Please sign in to comment.