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

Update deprecated QNode.(q)tape property usage in tests #6625

Merged
merged 65 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
870fde5
initial test fixing
andrijapau Nov 21, 2024
ea4cd2e
more test fixes
andrijapau Nov 21, 2024
f12c6a5
Merge branch 'master' into fix-tape-property-tests
andrijapau Nov 21, 2024
fd0d1f3
more fixing
andrijapau Nov 21, 2024
a572387
update qasm tests to not have to rely on qnode so much
andrijapau Nov 21, 2024
913ba14
fix: Update test_undo_swaps.py
andrijapau Dec 3, 2024
df1d397
fix: Update test_single_qubit_fusion.py
andrijapau Dec 3, 2024
24df24c
fix: Update test_pattern_matching.py
andrijapau Dec 3, 2024
1d30592
fix: Update test_merge_rotations.py
andrijapau Dec 3, 2024
4e9ec3c
Merge branch 'master' into fix-tape-property-tests
andrijapau Dec 3, 2024
f982f2b
fix: Update test_merge_amplitude_embedding.py
andrijapau Dec 6, 2024
284aa5b
fix: Update test_cancel_inverses.py
andrijapau Dec 6, 2024
8a06000
fix: Update test_unitary_to_rot.py
andrijapau Dec 6, 2024
90e8b0f
fix: Update test_transpile.py
andrijapau Dec 6, 2024
e1769a0
fix: Update test_qcut.py
andrijapau Dec 6, 2024
166eecc
fix: Update test_defer_measurements.py
andrijapau Dec 6, 2024
8afed8f
Merge branch 'master' into fix-tape-property-tests
andrijapau Dec 6, 2024
9ee5179
fix: Update test_undo_swaps.py
andrijapau Dec 6, 2024
497eb29
fix: Update test_cliffordt_transform.py
andrijapau Dec 6, 2024
9a455ba
fix: Update test_shadow_transforms.py
andrijapau Dec 6, 2024
84de40d
fix: Update test_tape.py
andrijapau Dec 6, 2024
f4c6412
fix: Update test_error.py
andrijapau Dec 6, 2024
6cde536
fix: Update test_qnn_torch.py
andrijapau Dec 6, 2024
7bddb48
fix: Update test_keras.py
andrijapau Dec 6, 2024
500fe1a
fix: Update test_adaptive.py
andrijapau Dec 6, 2024
c5bc4a5
fix: Update test_sum.py
andrijapau Dec 6, 2024
c544c43
fix: Update test_prod.py
andrijapau Dec 6, 2024
dbbe84b
fix: Update test_exp.py
andrijapau Dec 6, 2024
017644b
fix: Update test_condition.py
andrijapau Dec 6, 2024
35cbc37
fix: Update test_simplify.py
andrijapau Dec 6, 2024
0cb40e9
fix: Update test_map_wires.py
andrijapau Dec 6, 2024
ea80a47
fix: Update test_meta.py
andrijapau Dec 6, 2024
0ac1401
fix: Update test_numpy_wrapper.py
andrijapau Dec 6, 2024
52e92a4
fix: Update test_classical_shadow.py
andrijapau Dec 6, 2024
100ab3e
fix: Update test_torch_qnode.py
andrijapau Dec 6, 2024
3df1dc8
fix: Update test_tensorflow_qnode.py
andrijapau Dec 6, 2024
8ad7341
Merge branch 'master' into fix-tape-property-tests
andrijapau Dec 6, 2024
232eeec
fix: Update test_jax_qnode.py
andrijapau Dec 6, 2024
e32aa1d
fix: Update jax_jit and tf files there was an error
andrijapau Dec 6, 2024
943c928
fix: Update test_compile.py
andrijapau Dec 6, 2024
284bc51
Merge branch 'master' into fix-tape-property-tests
andrijapau Dec 6, 2024
641315d
fix: Update test_map_wires.py
andrijapau Dec 9, 2024
34a700b
fix: Remove all construct_tape from test_jax_qnode.py
andrijapau Dec 9, 2024
ff49d36
fix: Remove all construct_tape from test_tensorflow_qnode.py
andrijapau Dec 9, 2024
ad830fe
fix: Remove qtape usage in test_autograd_qnode.py
andrijapau Dec 9, 2024
8b4cb3b
Merge branch 'master' into fix-tape-property-tests
andrijapau Dec 9, 2024
791c657
Merge branch 'fix-tape-property-tests' of github.com:PennyLaneAI/penn…
andrijapau Dec 9, 2024
804fe97
fix: Remove qtape usage in test_default_mixed_jax.py
andrijapau Dec 9, 2024
ba12ded
fix: Remove tape construction from test_jax_jit_qnode.py
andrijapau Dec 9, 2024
1ee6091
fix: Restore all tests/interfaces to master
andrijapau Dec 9, 2024
976848d
Merge branch 'master' into fix-tape-property-tests
andrijapau Dec 16, 2024
b69cf73
fix: Run black on test_map_wires.py for formatting error
andrijapau Dec 16, 2024
1f5e293
fix: Restore test_default_mixed_jax.py bc it uses trainable_params
andrijapau Dec 17, 2024
2fd14a1
fix: Update test_default_mixed_jax.py to not use trainable_params pro…
andrijapau Dec 17, 2024
f000858
fix: Update test_default_mixed_jax.py to get rid of warning suppression
andrijapau Dec 17, 2024
5e31d38
fix: Update test_autograd_qnode.py
andrijapau Dec 17, 2024
df827cb
fix: Update test_torch_qnode.py
andrijapau Dec 17, 2024
6d69609
fix: Update test_tensorflow_qnode.py
andrijapau Dec 17, 2024
bcc9b29
fix: Update test_jax_qnode.py
andrijapau Dec 17, 2024
a2be158
fix: Update test_jax_jit_qnode.py
andrijapau Dec 17, 2024
5a336ee
refactor: Update test_parameter_shift_hessian.py to simplify code lin…
andrijapau Dec 18, 2024
6fdf84d
Update tests/gradients/core/test_adjoint_metric_tensor.py
andrijapau Dec 18, 2024
1ec4228
Update tests/gradients/core/test_adjoint_metric_tensor.py
andrijapau Dec 18, 2024
f10628c
Update tests/gradients/core/test_adjoint_metric_tensor.py
andrijapau Dec 18, 2024
b34c15c
Merge branch 'master' into fix-tape-property-tests
andrijapau Dec 18, 2024
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
24 changes: 10 additions & 14 deletions tests/circuit_graph/test_circuit_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import contextlib
import io
import warnings

import numpy as np
import pytest
Expand All @@ -30,13 +29,6 @@
from pennylane.wires import Wires


@pytest.fixture(autouse=True)
def suppress_tape_property_deprecation_warning():
warnings.filterwarnings(
"ignore", "The tape/qtape property is deprecated", category=qml.PennyLaneDeprecationWarning
)


@pytest.fixture(name="ops")
def ops_fixture():
"""A fixture of a complex example of operations that depend on previous operations."""
Expand Down Expand Up @@ -261,8 +253,10 @@ def test_layers(self, parametrized_circuit_gaussian, wires):

dev = qml.device("default.gaussian", wires=wires)
qnode = qml.QNode(parametrized_circuit_gaussian, dev)
qnode(*pnp.array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6], requires_grad=True))
circuit = qnode.qtape.graph
tape = qml.workflow.construct_tape(qnode)(
*pnp.array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6], requires_grad=True)
)
circuit = tape.graph
layers = circuit.parametrized_layers
ops = circuit.operations

Expand All @@ -280,8 +274,10 @@ def test_iterate_layers(self, parametrized_circuit_gaussian, wires):

dev = qml.device("default.gaussian", wires=wires)
qnode = qml.QNode(parametrized_circuit_gaussian, dev)
qnode(*pnp.array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6], requires_grad=True))
circuit = qnode.qtape.graph
tape = qml.workflow.construct_tape(qnode)(
*pnp.array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6], requires_grad=True)
)
circuit = tape.graph
result = list(circuit.iterate_parametrized_layers())

assert len(result) == 3
Expand Down Expand Up @@ -314,8 +310,8 @@ def test_max_simultaneous_measurements(self, circ, expected):

dev = qml.device("default.qubit", wires=3)
qnode = qml.QNode(circ, dev)
qnode()
circuit = qnode.qtape.graph
tape = qml.workflow.construct_tape(qnode)()
circuit = tape.graph
assert circuit.max_simultaneous_measurements == expected

def test_print_contents(self):
Expand Down
Loading
Loading