From 7c38c96773df9d917b49a945a035fa190692851d Mon Sep 17 00:00:00 2001 From: Ali Asadi <10773383+maliasadi@users.noreply.github.com> Date: Thu, 22 Aug 2024 18:52:31 -0400 Subject: [PATCH] Revert tests for multi-controlled-zyz (#821) ### Before submitting Please complete the following checklist when submitting a PR: - [ ] All new features must include a unit test. If you've fixed a bug or added code that should be tested, add a test to the [`tests`](../tests) directory! - [ ] All new functions and code must be clearly commented and documented. If you do make documentation changes, make sure that the docs build and render correctly by running `make docs`. - [x] Ensure that the test suite passes, by running `make test`. - [x] Add a new entry to the `.github/CHANGELOG.md` file, summarizing the change, and including a link back to the PR. - [x] Ensure that code is properly formatted by running `make format`. When all the above are checked, delete everything above the dashed line and fill in the pull request template. ------------------------------------------------------------------------------------------------------------ **Context:** PR https://github.com/PennyLaneAI/pennylane/pull/6042 adds support for multi-controlled zyz. For Lightning, this means that custom decompositions to special zyz with multiple controlled wires will be supported. **Description of the Change:** - Add tests for adjoint jacobian of the controlled gate with multiple controlled_wires. **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** [sc-67711] --------- Co-authored-by: ringo-but-quantum --- .github/CHANGELOG.md | 3 +++ .github/workflows/wheel_linux_aarch64_cuda.yml | 2 +- pennylane_lightning/core/_version.py | 2 +- tests/test_adjoint_jacobian.py | 9 ++++----- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index d355136bde..b41152626c 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -36,6 +36,9 @@ ### Improvements +* Update `ctrl_decomp_zyz` tests with `len(control_wires) > 1`. + [(#821)](https://github.com/PennyLaneAI/pennylane-lightning/pull/821) + * Update Lightning tests to support the generalization of basis state preparation. [(#864)](https://github.com/PennyLaneAI/pennylane-lightning/pull/864) diff --git a/.github/workflows/wheel_linux_aarch64_cuda.yml b/.github/workflows/wheel_linux_aarch64_cuda.yml index ecd85e0163..352fadc430 100644 --- a/.github/workflows/wheel_linux_aarch64_cuda.yml +++ b/.github/workflows/wheel_linux_aarch64_cuda.yml @@ -106,7 +106,7 @@ jobs: github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master' with: - name: ${{ runner.os }}-wheels-${{ matrix.pl_backend }}-${{ matrix.arch }}.zip + name: ${{ runner.os }}-wheels-${{ matrix.pl_backend }}-${{ matrix.arch }}-cu${{ matrix.cuda_version }} path: ./wheelhouse/*.whl upload-pypi: diff --git a/pennylane_lightning/core/_version.py b/pennylane_lightning/core/_version.py index b7dfacadb0..8dd47c9d0a 100644 --- a/pennylane_lightning/core/_version.py +++ b/pennylane_lightning/core/_version.py @@ -16,4 +16,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "0.38.0-dev44" +__version__ = "0.38.0-dev45" diff --git a/tests/test_adjoint_jacobian.py b/tests/test_adjoint_jacobian.py index 5d5a9115b1..a44df09d4f 100644 --- a/tests/test_adjoint_jacobian.py +++ b/tests/test_adjoint_jacobian.py @@ -865,13 +865,12 @@ def test_controlled_jacobian(self, par, n_qubits, control_value, operation, tol) def circuit(p): qml.StatePrep(init_state, wires=range(n_qubits)) if operation.num_params == 3: - # Check against the first wire in `control_wires` as any - # decomposition to `ctrl_decomp_zyz` works now with only - # one single controlled wire. qml.ctrl( operation(*p, wires=range(n_qubits - num_wires, n_qubits)), - control_wires[0], - control_values=control_value, + control_wires, + control_values=[ + control_value or bool(i % 2) for i, _ in enumerate(control_wires) + ], ) else: qml.RX(p[0], 0)