Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding unit test for measurement with shots for LT with tn method #1027

Merged
merged 5 commits into from
Dec 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
apply suggestion Ali and Joseph
  • Loading branch information
LuisAlfredoNu committed Dec 17, 2024
commit 73c438ff466241b6afb04c99ca9e436b4a48a516
24 changes: 8 additions & 16 deletions tests/lightning_qubit/test_measurements_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -793,11 +793,8 @@ def test_controlled_qubit_gates(self, operation, n_qubits, control_value, tol, l
tape = qml.tape.QuantumScript(ops, measurements)

statevector = lightning_sv(n_qubits)
if device_name == "lightning.tensor":
if statevector.method == "tn":
pytest.skip(
"StatePrep not supported in lightning.tensor with the tn method."
)
if device_name == "lightning.tensor" and statevector.method == "tn":
pytest.skip("StatePrep not supported in lightning.tensor with the tn method.")

statevector = get_final_state(statevector, tape)
m = LightningMeasurements(statevector)
Expand Down Expand Up @@ -856,9 +853,8 @@ def test_cnot_controlled_qubit_unitary(self, control_wires, target_wires, tol, l
)

statevector = lightning_sv(n_qubits)
if device_name == "lightning.tensor":
if statevector.method == "tn":
pytest.skip("StatePrep not supported in lightning.tensor with the tn method.")
if device_name == "lightning.tensor" and statevector.method == "tn":
pytest.skip("StatePrep not supported in lightning.tensor with the tn method.")

statevector = get_final_state(statevector, tape)
m = LightningMeasurements(statevector)
Expand Down Expand Up @@ -904,11 +900,8 @@ def test_controlled_globalphase(self, n_qubits, control_value, tol, lightning_sv
[qml.state()],
)
statevector = lightning_sv(n_qubits)
if device_name == "lightning.tensor":
if statevector.method == "tn":
pytest.skip(
"StatePrep not supported in lightning.tensor with the tn method."
)
if device_name == "lightning.tensor" and statevector.method == "tn":
pytest.skip("StatePrep not supported in lightning.tensor with the tn method.")

statevector = get_final_state(statevector, tape)
m = LightningMeasurements(statevector)
Expand Down Expand Up @@ -988,9 +981,8 @@ def test_state_vector_2_qubit_subset(tol, op, par, wires, expected, lightning_sv
)

statevector = lightning_sv(2)
if device_name == "lightning.tensor":
if statevector.method == "tn":
pytest.skip("StatePrep not supported in lightning.tensor with the tn method.")
if device_name == "lightning.tensor" and statevector.method == "tn":
pytest.skip("StatePrep not supported in lightning.tensor with the tn method.")

statevector = get_final_state(statevector, tape)

Expand Down
Loading