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

Test changes to account for 0.39 deprecations #912

Merged
merged 3 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 4 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@

### Improvements

* Update the test suite to remove deprecated code.
[(#912)](https://github.com/PennyLaneAI/pennylane-lightning/pull/912)

* Skip the compilation of Lightning simulators and development requirements to boost the build of public docs up to 5x.
[(#904)](https://github.com/PennyLaneAI/pennylane-lightning/pull/904)

Expand Down Expand Up @@ -75,7 +78,7 @@

This release contains contributions from (in alphabetical order):

Ali Asadi, Amintor Dusko, Luis Alfredo Nuñez Meneses, Vincent Michaud-Rioux, Lee J. O'Riordan, Shuli Shu
Ali Asadi, Amintor Dusko, Luis Alfredo Nuñez Meneses, Vincent Michaud-Rioux, Lee J. O'Riordan, Mudit Pandey, Shuli Shu

---

Expand Down
6 changes: 3 additions & 3 deletions mpitests/test_adjoint_jacobian.py
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,7 @@ def circuit(params):
def test_qubit_unitary(dev, n_targets):
"""Tests that ``qml.QubitUnitary`` can be included in circuits differentiated with the adjoint method."""
n_wires = len(dev.wires)
dev_def = qml.device("default.qubit.legacy", wires=n_wires)
dev_def = qml.device("default.qubit", wires=n_wires)
h = 1e-3 if dev.R_DTYPE == np.float32 else 1e-7
c_dtype = np.complex64 if dev.R_DTYPE == np.float32 else np.complex128

Expand All @@ -1396,7 +1396,7 @@ def test_qubit_unitary(dev, n_targets):

init_state = np.array(init_state, requires_grad=False, dtype=c_dtype)
U = np.array(U, requires_grad=False, dtype=c_dtype)
obs = qml.operation.Tensor(*(qml.PauliZ(i) for i in range(n_wires)))
obs = qml.prod(*(qml.PauliZ(i) for i in range(n_wires)))

def circuit(x):
qml.StatePrep(init_state, wires=range(n_wires))
Expand Down Expand Up @@ -1444,7 +1444,7 @@ def test_diff_qubit_unitary(dev, n_targets):

init_state = np.array(init_state, requires_grad=False, dtype=c_dtype)
U = np.array(U, requires_grad=False, dtype=c_dtype)
obs = qml.operation.Tensor(*(qml.PauliZ(i) for i in range(n_wires)))
obs = qml.prod(*(qml.PauliZ(i) for i in range(n_wires)))

def circuit(x, u_mat):
qml.StatePrep(init_state, wires=range(n_wires))
Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/core/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
Version number (major.minor.patch[-label])
"""

__version__ = "0.39.0-dev24"
__version__ = "0.39.0-dev25"
2 changes: 1 addition & 1 deletion tests/test_adjoint_jacobian.py
Original file line number Diff line number Diff line change
Expand Up @@ -1544,7 +1544,7 @@ def test_qubit_unitary(n_targets):
"""Tests that ``qml.QubitUnitary`` can be included in circuits differentiated with the adjoint method."""
n_wires = 6
dev = qml.device(device_name, wires=n_wires)
dev_def = qml.device("default.qubit.legacy", wires=n_wires)
dev_def = qml.device("default.qubit", wires=n_wires)

np.random.seed(1337)
init_state = np.random.rand(2**n_wires) + 1j * np.random.rand(2**n_wires)
Expand Down
Loading