Skip to content

Commit

Permalink
Revert tests for multi-controlled-zyz (#821)
Browse files Browse the repository at this point in the history
### 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 PennyLaneAI/pennylane#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 <[email protected]>
  • Loading branch information
maliasadi and ringo-but-quantum authored Aug 22, 2024
1 parent ee837d6 commit 7c38c96
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheel_linux_aarch64_cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
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.38.0-dev44"
__version__ = "0.38.0-dev45"
9 changes: 4 additions & 5 deletions tests/test_adjoint_jacobian.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7c38c96

Please sign in to comment.