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

Circuit templates for the plugins #2

Closed
smite opened this issue Aug 1, 2018 · 2 comments
Closed

Circuit templates for the plugins #2

smite opened this issue Aug 1, 2018 · 2 comments
Labels
core :atom: Core functionality (Operations, QNodes, CircuitGraphs) devices 💻 Device or plugin API related documentation 📘 Documentation changes and updates enhancement ✨ New feature or request
Milestone

Comments

@smite
Copy link
Contributor

smite commented Aug 1, 2018

The plugins need better, more relevant circuit templates. The current templates are more or less just arbitrary gate sequences to have something to run tests on.

@smite smite added enhancement ✨ New feature or request devices 💻 Device or plugin API related documentation 📘 Documentation changes and updates labels Aug 1, 2018
@smite
Copy link
Contributor Author

smite commented Aug 1, 2018

Each template should also be briefly documented, to explain its purpose and usefulness to the user.

@co9olguy co9olguy added the core :atom: Core functionality (Operations, QNodes, CircuitGraphs) label Aug 3, 2018
@co9olguy co9olguy added this to the version 0.1 milestone Aug 3, 2018
@co9olguy
Copy link
Member

@smite I believe this is will be covered in the examples that @mariaschuld is coding up, so I will close this issue. Let me know if I have misunderstood what you meant.

antalszava added a commit that referenced this issue Sep 1, 2021
) (#1585)

* Update diff_method attribute (#2)

Update diff_method attribute of QNode to reflect the change when the "best" method has been selected.

* Comment added

* Update

* Set diff_method back to "best"

Set diff_method back to "best" when the tape is re-validated

* update

* Update test_qnode_print

Updated test_qnode_print.
Removed "best" as diff_method will not show "best" anymore.
For print check, modified the previous assert. The function of the test remains the same.

* Black format update

* Update QNode initialization

If QNode was changed due to diff_method="best" change, the method might be "backprop" but the interface wouldn't have changed.
Thus, check if the diff_method was changed, and if it was, use the to_tf attribute of QNode for proper conversion.

* Add test_qnode_best_diff_method

Added test to check that the selected "best" diff_method is available after QNode initialization.
This checks for only "backprop".

* fix typo

* Update test_qnode_best_diff_method

Update test_qnode_best_diff_method to check all four "best" diff_method options.

* Split test_qnode_best_diff_method

Split test_qnode_best_diff_method into four separate tests for the four different possibilities of the "best" method

* [Code Together] Update diff_method attribute (#2) #1568

* Added tests to check interface change

Added four tests to check interface changes are working.
QNode.to_tf()
QNode.to_tensorflow()
QNode.to_jax()
QNode.to_autograd()

* Removed test_best_diff_method_to_jax

* Updated interface change tests

Checks interface changes
QNode.to_jax()
QNode.to_autograd()
QNode.to_tf()
Qnode.to_torch()

These tests can be combined into one.

* Update black format

* reformatting some code

* [Code Together] Update diff_method attribute #1568

Co-authored-by: Theodor <theodor.isacsson@gmail.com>

* reformat code

Co-authored-by: Theodor <theodor.isacsson@gmail.com>

* black format

* Reformat code + fix typo

* diff_method = None enabled

* Update test_qnode.py

* Update qnode.py

* Update qnode.py

* Update test_qnode.py

* Update CHANGELOG.md

* Update test_qnode.py

* Update keras.py

* Update qnode.py

* Update test_qnode.py

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update test_qnode.py

* Add update for #1585

* Update pennylane/qnode.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update CHANGELOG.md

* Update test_qnode.py

* fix typo

* diff_method=None update

Added comment for clarity and suggest future actions

Co-authored-by: antalszava <antalszava@gmail.com>

* remove extra spaces

* Update test_diff_method_None

Add extra cases to check

* Reorganize test_diff_method_none

* Update .github/CHANGELOG.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update test_qnode.py

Co-authored-by: antalszava <antalszava@gmail.com>
Co-authored-by: Theodor <theodor.isacsson@gmail.com>
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
thisac added a commit that referenced this issue Sep 2, 2021
* Update diff_method attribute (#2)

Update diff_method attribute of QNode to reflect the change when the "best" method has been selected.

* Comment added

* Update

* Set diff_method back to "best"

Set diff_method back to "best" when the tape is re-validated

* update

* Update test_qnode_print

Updated test_qnode_print.
Removed "best" as diff_method will not show "best" anymore.
For print check, modified the previous assert. The function of the test remains the same.

* Black format update

* Update QNode initialization

If QNode was changed due to diff_method="best" change, the method might be "backprop" but the interface wouldn't have changed.
Thus, check if the diff_method was changed, and if it was, use the to_tf attribute of QNode for proper conversion.

* Add test_qnode_best_diff_method

Added test to check that the selected "best" diff_method is available after QNode initialization.
This checks for only "backprop".

* fix typo

* Update test_qnode_best_diff_method

Update test_qnode_best_diff_method to check all four "best" diff_method options.

* Split test_qnode_best_diff_method

Split test_qnode_best_diff_method into four separate tests for the four different possibilities of the "best" method

* [Code Together] Update diff_method attribute (#2) #1568

* Added tests to check interface change

Added four tests to check interface changes are working.
QNode.to_tf()
QNode.to_tensorflow()
QNode.to_jax()
QNode.to_autograd()

* Removed test_best_diff_method_to_jax

* Updated interface change tests

Checks interface changes
QNode.to_jax()
QNode.to_autograd()
QNode.to_tf()
Qnode.to_torch()

These tests can be combined into one.

* Update black format

* reformatting some code

* [Code Together] Update diff_method attribute #1568

Co-authored-by: Theodor <theodor.isacsson@gmail.com>

* reformat code

Co-authored-by: Theodor <theodor.isacsson@gmail.com>

* black format

* Reformat code + fix typo

* black format

* black format

* add support for fall-back cases

* add test_qnode_best_diff_method_finite_fallback

Test that selected "best" diff_method is correctly set to 'finite-diff'' in cases where other methods are not available.

* Update qnode.py

* black

* Update test_qnode.py

Reset grad_method to 'A' after the test_qnode_best_diff_method_finite_fallback.

* black format

* Update qnode.py

#1568 (comment)
In response to this.

* Update test_qnode.py

* Update interface change tests

Update interface change tests

* Update test_qnode.py

* Update qnode.py

* Update qnode.py

* Update tests/tape/test_qnode.py

Co-authored-by: Theodor <theodor.isacsson@gmail.com>

* Update tests/tape/test_qnode.py

Co-authored-by: Theodor <theodor.isacsson@gmail.com>

* fix missing value

* Update qnode.py

Co-authored-by: antalszava <antalszava@gmail.com>
Co-authored-by: Theodor <theodor.isacsson@gmail.com>
Co-authored-by: Theodor <theodor@xanadu.ai>
antalszava added a commit that referenced this issue Jun 14, 2022
* Update diff_method attribute (#2)

Update diff_method attribute of QNode to reflect the change when the "best" method has been selected.

* Comment added

* Update

* Set diff_method back to "best"

Set diff_method back to "best" when the tape is re-validated

* update

* Update test_qnode_print

Updated test_qnode_print.
Removed "best" as diff_method will not show "best" anymore.
For print check, modified the previous assert. The function of the test remains the same.

* Black format update

* Update QNode initialization

If QNode was changed due to diff_method="best" change, the method might be "backprop" but the interface wouldn't have changed.
Thus, check if the diff_method was changed, and if it was, use the to_tf attribute of QNode for proper conversion.

* Add test_qnode_best_diff_method

Added test to check that the selected "best" diff_method is available after QNode initialization.
This checks for only "backprop".

* fix typo

* Update test_qnode_best_diff_method

Update test_qnode_best_diff_method to check all four "best" diff_method options.

* Split test_qnode_best_diff_method

Split test_qnode_best_diff_method into four separate tests for the four different possibilities of the "best" method

* [Code Together] Update diff_method attribute (#2) #1568

* Added tests to check interface change

Added four tests to check interface changes are working.
QNode.to_tf()
QNode.to_tensorflow()
QNode.to_jax()
QNode.to_autograd()

* Removed test_best_diff_method_to_jax

* Updated interface change tests

Checks interface changes
QNode.to_jax()
QNode.to_autograd()
QNode.to_tf()
Qnode.to_torch()

These tests can be combined into one.

* Update black format

* reformatting some code

* [Code Together] Update diff_method attribute #1568

Co-authored-by: Theodor <theodor.isacsson@gmail.com>

* reformat code

Co-authored-by: Theodor <theodor.isacsson@gmail.com>

* black format

* Reformat code + fix typo

* black format

* black format

* add support for fall-back cases

* add test_qnode_best_diff_method_finite_fallback

Test that selected "best" diff_method is correctly set to 'finite-diff'' in cases where other methods are not available.

* Update qnode.py

* black

* Update test_qnode.py

Reset grad_method to 'A' after the test_qnode_best_diff_method_finite_fallback.

* black format

* Update qnode.py

#1568 (comment)
In response to this.

* Update test_qnode.py

* Update interface change tests

Update interface change tests

* Update test_qnode.py

* Update qnode.py

* Update qnode.py

* Update tests/tape/test_qnode.py

Co-authored-by: Theodor <theodor.isacsson@gmail.com>

* Update tests/tape/test_qnode.py

Co-authored-by: Theodor <theodor.isacsson@gmail.com>

* fix missing value

* Update qnode.py

* add equal function and tests

* add doc

* add doc + pylint disable

* update doc

* fix interface detection in test

* remove assert statements in favor of returns

* pylint

* change test

* change test

* add test

* add back IsingXY

* changelog

* use qml.math functions

* remove outdated comment

Co-authored-by: antalszava <antalszava@gmail.com>
Co-authored-by: Theodor <theodor.isacsson@gmail.com>
Co-authored-by: Theodor <theodor@xanadu.ai>
Co-authored-by: Sam Banning <samcbanning@gmail.com>
dime10 added a commit that referenced this issue Jun 22, 2022
* Update installation guide

* Ignore openfermionpyscf if it cannot be installed

Currently, pyscf does not provide a release for python3.10 which ships
with Ubuntu jammy (22.04LTS).
We can attempt installation of the openfermionpyscf package, but ignore
it if its installation fails (the package is only used for the
non-differentiable backend of the qml.qchem module). That way, the
package will automatically be included again in the docker build once
pyscf becomes available for python3.10 (scheduled for version 2.1).

* Update changelog

Co-authored-by: Romain Moyard <rmoyard@gmail.com>
glassnotes added a commit that referenced this issue Jul 20, 2022
* Added default qutrit class

* Added operations files for qutrits

* Add non-parametric ops. Work on parametric ops

* Added matrix ops file for qutrits

* Added qutrit unitary

* Added methods to qutrit device

* Added TODO's

* Added measurement related methods to qutrit device

* Adding skeleton code to default.qutrit

* Testing qutrit device

* Fixing bugs

* Debugging

* Added shift and clock

* Added TAdd(wires)

* Added SWAP operation

* Fixing qutrit unitary bug

* Fixed _apply_unitary() bug in default qutrit

* Added custom implementations for clock and shift

* Added custom implementation for TSWAP

* Added custom implementation for TAdd

* Minor changes

* Minor changed to matrix_ops

* Added test files

* Passed all tests for qutrit unitary

* Removed main

* Renamed qutrit matrix ops test file

* Removing code/files for PR

* Added tests for QutritDevice

* Added tests for QutritDevice

* Added tests and test config for default qutrit

* updated changelog

* Added tests for wire and prob integration

* Update doc/releases/changelog-dev.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update doc/releases/changelog-dev.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update doc/releases/changelog-dev.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update doc/releases/changelog-dev.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/test_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Addressing PR comments

* Added changes to address PR comments

* Fixed changelog-dev.md

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Adding changes for PR

* Reformatted new files, Updated comments

* Fixed qutrit matrix ops test

* Reformatted and refactored code

* Made QutritDevice inherit QubitDevice

* Tested new version of qutrit device

* Removed default.qutrit to decrease PR size

* Reformatting and refactoring

* Minor changes

* Removed references to default.qutrit

* Fixed issues with testing suite for qutrit device

* Removed references to default qutrit

* Minor change to comments

* Added tests for better coverage

* Added tests for more coverage

* Updated doc/releases.changelog-dev.md

* Update doc/releases/changelog-dev.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/test_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/test_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/test_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/test_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Added changes recommended on PR

* Remove QutritUnitary example from changelog-dev.md

* Update doc/releases/changelog-dev.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update doc/releases/changelog-dev.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update doc/releases/changelog-dev.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated comments in test_qutrit_device

* Removed QutritDevice

* Addressing conflicts

* Updated changelog-dev.md

* Made changes to address PR review

* Update doc/releases/changelog-dev.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Added changes recommended in PR review

* Reformatting

* Added changes to qutrit device and tests for PR

* Added QutritDevice for PR

* Added methods to QutritDevice and tests for PR

* Added QutritDevice to __init__.py

* Updated changelog to resolve conflicts

* Added imports

* Updated dev changelog

* Updated changelog

* Added comment with better description

* Added comments to address PR review

* Update doc/releases/changelog-dev.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/test_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/test_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update doc/releases/changelog-dev.md

Co-authored-by: antalszava <antalszava@gmail.com>

* Updated marginal probs documentation

* Minor changes

* Fixed tests to contain code in correct context

* Removed artefacts from other branch

* Minor change to changelog

* Update tests/test_qutrit_device.py

Co-authored-by: antalszava <antalszava@gmail.com>

* Changes to address PR review

* Updating tests

* Updated test_qutrit_device test_device_executions

* Refactoring

* Fixed sampling with counts. Added tests

* Added test for coverage

* Update tests/test_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Reformatted test_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: antalszava <antalszava@gmail.com>
antalszava added a commit that referenced this issue Jul 29, 2022
* draft

* more

* fix a bug; shot vector Counts returns tuple; Autograd interface update

* test file

* single_measurement

* more tests

* first multi-meas attempt

* multi_measures

* merge

* Update

* update

* Move tests

* Revert autograd

* Unecessary change

* Solve issue

* Add statistics new

* [skip-ci]

* more test cases for probs and sample multi (proj; tensor product)

* more test cases for probs and sample multi (proj; tensor product)

* multi-measure: Counts tests

* test docstrings

* adjust test

* no more is_sampled; probs sample with obs test

* probs and sample test

* more tests

* probs tests

* more more tests

* refactor

* refactor tests

* update cov; add vanilla counts test (xfail) for finite shots

* restore statistics docstring

* process counts for finite shots

* create shot_vec_statistics aux method

* Apply suggestions from code review

Co-authored-by: Romain Moyard <rmoyard@gmail.com>

* fix

* suggestion

* refactors

* revert to have squeeze in expval

* docstring and more tests

* move squeezing further up and leave comment

* explain

* parametrize over shots too

* comments

* parametrize

Co-authored-by: Romain Moyard <rmoyard@gmail.com>
antalszava added a commit that referenced this issue Jul 29, 2022
* First working version

* test

* Update

* Update

* Update

* Remove autograd_changes

* Comment

* Update

* Coverage

* Typo

* Add tests

* Update tests/test_new_return_types.py

Co-authored-by: antalszava <antalszava@gmail.com>

* Update pennylane/_qubit_device.py

Co-authored-by: antalszava <antalszava@gmail.com>

* 📝 Update from review

Update documentation and fix a test

* ✅ Update test

Change the state shape requ

* Update pennylane/interfaces/execution.py

Co-authored-by: antalszava <antalszava@gmail.com>

* ✅ Add default mixed to tests

It required to change default mixed asarray

* [Return-types #2] Refactor return types (shot vector cases) (#2815)

* draft

* more

* fix a bug; shot vector Counts returns tuple; Autograd interface update

* test file

* single_measurement

* more tests

* first multi-meas attempt

* multi_measures

* merge

* Update

* update

* Move tests

* Revert autograd

* Unecessary change

* Solve issue

* Add statistics new

* [skip-ci]

* more test cases for probs and sample multi (proj; tensor product)

* more test cases for probs and sample multi (proj; tensor product)

* multi-measure: Counts tests

* test docstrings

* adjust test

* no more is_sampled; probs sample with obs test

* probs and sample test

* more tests

* probs tests

* more more tests

* refactor

* refactor tests

* update cov; add vanilla counts test (xfail) for finite shots

* restore statistics docstring

* process counts for finite shots

* create shot_vec_statistics aux method

* Apply suggestions from code review

Co-authored-by: Romain Moyard <rmoyard@gmail.com>

* fix

* suggestion

* refactors

* revert to have squeeze in expval

* docstring and more tests

* move squeezing further up and leave comment

* explain

* parametrize over shots too

* comments

* parametrize

Co-authored-by: Romain Moyard <rmoyard@gmail.com>

* run CI

Co-authored-by: antalszava <antalszava@gmail.com>
rmoyard added a commit that referenced this issue Aug 5, 2022
)

* draft

* more

* First working version

* fix a bug; shot vector Counts returns tuple; Autograd interface update

* test file

* single_measurement

* more tests

* test

* first multi-meas attempt

* multi_measures

* Update

* Update

* merge

* Update

* update

* Update

* Remove autograd_changes

* Comment

* Update

* Coverage

* Typo

* Add tests

* Move tests

* Revert autograd

* Unecessary change

* Solve issue

* Add statistics new

* Update tests/test_new_return_types.py

Co-authored-by: antalszava <antalszava@gmail.com>

* Update pennylane/_qubit_device.py

Co-authored-by: antalszava <antalszava@gmail.com>

* 📝 Update from review

Update documentation and fix a test

* ✅ Update test

Change the state shape requ

* ✨ QNode integration

Add the enable and disable function for return types

* ♻️ Remove global

Replace Global by a class

* [skip-ci]

* ✅ Add tests for QNode integration

* more test cases for probs and sample multi (proj; tensor product)

* more test cases for probs and sample multi (proj; tensor product)

* multi-measure: Counts tests

* test docstrings

* ✨ Support Autograd Jacobian

Allow to return a ragged array and use Jacobian

* adjust test

* no more is_sampled; probs sample with obs test

* probs and sample test

* ✨ All interface backprop Jacobian

Ragged for Autograd and TF // tuple for Jax and Torch

* ✅ Update tests

* more tests

* probs tests

* more more tests

* refactor

* refactor tests

* update cov; add vanilla counts test (xfail) for finite shots

* restore statistics docstring

* Update tests/test_new_return_types.py

* process counts for finite shots

* create shot_vec_statistics aux method

* Apply suggestions from code review

Co-authored-by: Romain Moyard <rmoyard@gmail.com>

* fix

* suggestion

* refactors

* revert to have squeeze in expval

* docstring and more tests

* Update pennylane/interfaces/execution.py

Co-authored-by: antalszava <antalszava@gmail.com>

* ✅ Add default mixed to tests

It required to change default mixed asarray

* 🐛 Bug introduced due to checking backprop

* ✅ Separate the tape and qnode tests

* ♻️ Refactor after review

* [Return-types #2] Refactor return types (shot vector cases) (#2815)

* draft

* more

* fix a bug; shot vector Counts returns tuple; Autograd interface update

* test file

* single_measurement

* more tests

* first multi-meas attempt

* multi_measures

* merge

* Update

* update

* Move tests

* Revert autograd

* Unecessary change

* Solve issue

* Add statistics new

* [skip-ci]

* more test cases for probs and sample multi (proj; tensor product)

* more test cases for probs and sample multi (proj; tensor product)

* multi-measure: Counts tests

* test docstrings

* adjust test

* no more is_sampled; probs sample with obs test

* probs and sample test

* more tests

* probs tests

* more more tests

* refactor

* refactor tests

* update cov; add vanilla counts test (xfail) for finite shots

* restore statistics docstring

* process counts for finite shots

* create shot_vec_statistics aux method

* Apply suggestions from code review

Co-authored-by: Romain Moyard <rmoyard@gmail.com>

* fix

* suggestion

* refactors

* revert to have squeeze in expval

* docstring and more tests

* move squeezing further up and leave comment

* explain

* parametrize over shots too

* comments

* parametrize

Co-authored-by: Romain Moyard <rmoyard@gmail.com>

* Update

* ✅ Update counts

* ✨ Support Tf autograph

* ✅ Update test

* ✨ Fix one element list

* Typo

* Default mixed asarray

* Trigger CI

* Trigger CI

* ✅ More tests

* Typo

* Trigger CI

* Update tests/math/test_functions.py

Co-authored-by: antalszava <antalszava@gmail.com>

* Update tests/math/test_functions.py

Co-authored-by: antalszava <antalszava@gmail.com>

* ✅ Rework test suite

* ✅ Test interfaces forward part

* Update tests/math/test_functions.py

Co-authored-by: antalszava <antalszava@gmail.com>

* Typo

* More

* Add runner

* Return marker and pragma

* Update .github/workflows/tests.yml

Co-authored-by: antalszava <antalszava@gmail.com>

* Trigger CI

* Trigger CI

Co-authored-by: Antal Szava <antalszava@gmail.com>
rmoyard pushed a commit that referenced this issue Aug 5, 2022
* feat (Operator): ✨ Add depth attribute. Add simplify method.

* feat (Sum): ✨ Add simplify method.

* style: 🎨 Solve pylint issues.

* style: 🎨 Add return types.

* feat (Adjoint): ✨ Add simplify method.

style (Adjoint): 🎨 Indent docs correctly.

* test (simplify): 🧪 Add tests.

* style: 🎨 Run black formatter.

* style: 🎨 Remove unused import.

* style: 🎨 Remove unused import.

* refactor (depth): ♻️ Change depth attribute to property. Change name to arithmetic_depth.

* style (Hamiltonian): 🎨 Ignore pylint error. Use next instead of for loop.

* chore (changelog): ✏️ Add feature to changelog.

* docs: 📝 Use correct syntax.

* feat (Pow): ✨ Add arithmetic_depth property and simplify method.

* docs: 📝 Remove useless docstrings.

* fix (simplify): 🐛 Fix depth.

* test (Pow): 🧪 Add simplify tests.

* feat (simplify): ✨ Add simplify wrapper.

* feat (adjoint): ✨ Adj(Sum) -> Sum(Adj).

* test (Adjoint): 🧪 Adj(Sum) -> Sum(Adj) test.

* test (simplify): 🧪 Add tests.

* feat (SProd): ✨ Add simplify method.

* chore (changelog): ✏️ Small change.

* feat (Pow): ✨ Return Identity when pow is 0.

* fix (SProd): 🐛 Simplify sum instead of summmands.

* test (SProd) 🧪 Increase cov.

* fix (SProd): 🐛 Simplify SProd of summand.

* test: 🧪 Increase coverage.

* test: 🧪 Fix variable name.

* fix (Sum): 🐛 Cast summands to list.

* Update pennylane/ops/op_math/adjoint_class.py

Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>

* style (Sum): 🎨 Remove TODO comment.

* Update pennylane/ops/op_math/pow_class.py

Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>

* fix (equal): 🐛 Raise NotImplementedError for nested operators.

* test (equal): 🧪 Add tests.

* test (op_math): 🧪 Remove qml.equal usage.

* feat (Pow): ✨ Pow(Controlled(base)) --> Controlled(Pow(base)).

* revert (equal): ⏪ Move changes to another PR.

* fix: 🐛 Fix small bug.

* refactor: ♻️ Remove id when simplifying.

* refactor (Controlled): ♻️ Move arithmetic_depth and simplify methods to Controlled class.

Add tests.

* test (Controlled): 🧪 Increase coverage.

* feat (simplify): ✨ Add tape_fn.

* feat (Prod): ✨ Add arithmetic_depth and simplify methods.

* feat (Operator): ✨ __mul__ dunder method.

* test (Operator): 🧪 Compare operators.

* test (Operator): 🧪 Add __mul__ test.

* chore (changelog): ✏️ Add feature to changelog.

* test (Operator): 🧪 Add test.

* test (Operator): 🧪 Add test.

* test (Prod): 🧪 Add simplify tests.

* test (Prod): 🧪 Add simplify tests.

* chore (changelog): ✏️ Add feature to changelog.

* refactor (Operation): ♻️ Remove dead line.

* docs: 📝 Fix docs.

* refactor (Operation): ♻️ Remove __rmul__.

* Update pennylane/ops/op_math/controlled_class.py

Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>

* Update pennylane/ops/op_math/pow_class.py

Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>

* Update pennylane/ops/op_math/pow_class.py

Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>

* fix: 🐛 Fix small bug.

* refactor: ♻️ Move arithmetic depth to SymbolicOp class.

* refactor: ♻️ Make _simplify_summands a classmethod.

* refactor (Hamiltonian): ♻️ Remove super call.

* feat (Operator): ✨ __matmul__ dunder method.

* chore (changelog): ✏️ Modify changelog.

* test (Observable): 🧪 Remove test.

* test (Prod): 🧪 Use @ for Prod.

* fix (Operator): 🐛 Use only one wire with Identity.

* Update doc/releases/changelog-dev.md

Co-authored-by: Christina Lee <christina@xanadu.ai>

* fix (Operator): 🐛 Use only one wire with Identity.

* refactor (simplify): ♻️ Remove depth.

* fix (Pow): 🐛 Simplify self.base.base.

* feat (Controlled): ✨ Simplify nested Controlled ops.

* test (Operator): 🧪 Increase coverage.

* test (Operator): 🧪 Increase coverage.

* Update pennylane/operation.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Update pennylane/operation.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Update tests/test_operation.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* test (Operator): 🧪 Fix test.

* test (Operator): 🧪 Support add for multiple wires.

* test (Operator): 🧪 Increase coverage.

* feat (s_prod): ✨ Add to init.

* Update pennylane/operation.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

* Update pennylane/operation.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

* fix: 🐛 Fix small bug.

* test (Operator): 🧪 Add test.

* test (Operator): 🧪 Add test.

* Update pennylane/ops/qubit/hamiltonian.py

Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>

* docs: 📝 Fix docs.

* feat (simplify): ✨ Support simplifcation inside QuantumTapes.

* test (Operator): 🧪 Add test.

* test (Operator): 🧪 Add test.

* refactor (Operator): ♻️ Use wrappers.

* refactor (Operator): ♻️ Use wrappers.

* refactor (simplify): ♻️ Remove depth.

* refactor (Prod): ♻️ Use tuples in simplify.

* feat (Adjoint): ✨ Simplify Adjoint(Prod).

* test (Prod): 🧪 Increase coverage.

* chore (changelog): ✏️ Add feature to changelog.

* docs: 📝 Fix docs.

* chore (changelog): ✏️ Small change.

* Update pennylane/ops/functions/simplify.py

Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>

* Update pennylane/ops/functions/simplify.py

Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>

* refactor (simplify): ♻️ Copy simplified operator.

* refactor (simplify): ♻️ Remove type def.

Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>
Co-authored-by: Christina Lee <christina@xanadu.ai>
Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>
Co-authored-by: antalszava <antalszava@gmail.com>
antalszava pushed a commit that referenced this issue Sep 9, 2022
* add hash

* use hash to compute eigendecomposition

* use eigvals of factors if they commute

* improve prod

* merge

* add hash to sum

* add tests

* revert

* docs

* expand matrix at the end

* refactor

* remove adjoint

* chore (changelog): ✏️ Add feature to changelog.

* chore (changelog): ✏️ Add feature to changelog.

* chore (changelog): ✏️ Add feature to changelog.

* Add improvements to sparse_matrix

* Update pennylane/ops/op_math/prod.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

* Update pennylane/ops/op_math/prod.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

* Update pennylane/ops/op_math/sum.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

* Update pennylane/ops/op_math/sum.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

* Update pennylane/ops/op_math/prod.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

* Update pennylane/ops/op_math/prod.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

Co-authored-by: Christina Lee <christina@xanadu.ai>
Jaybsoni added a commit that referenced this issue Sep 9, 2022
* Update pennylane/_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/test_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/test_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/test_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/test_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Added changes recommended on PR

* Remove QutritUnitary example from changelog-dev.md

* Update doc/releases/changelog-dev.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update doc/releases/changelog-dev.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update doc/releases/changelog-dev.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Added tests for default qutrit

* Commiting conftest so that it doesn't get overwritten

* Updated comments in test_qutrit_device

* Added tests for _apply_ops

* Added tests for default qutrit

* Removed QutritDevice

* Addressing conflicts

* Updated changelog-dev.md

* Added tests for DefaultQutrit.density_matrix()

* Made changes to address PR review

* Update doc/releases/changelog-dev.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Added changes recommended in PR review

* Reformatting

* Added changes to qutrit device and tests for PR

* Added QutritDevice for PR

* Added methods to QutritDevice and tests for PR

* Added QutritDevice to __init__.py

* Commented out code that will not be included in PR

* Removed functions not needed for this PR

* Updated changelog to resolve conflicts

* Added imports

* Reformatted and refactored default.qutrit

* Updated dev changelog

* Updated changelog

* Updated changelog

* Added observables.py for qutrits

* Reformatting

* Reformatting tests

* Added change for pylint

* Adding tests for THermitian

* Reformatted with black

* Added Identity as an observable to default.qutrit

* Minor change to conftest.py

* Updated THermitian. All tests pass

* Adding tests for expval and var

* Added comment with better description

* Added comments to address PR review

* Update doc/releases/changelog-dev.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/test_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/test_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Added tests for default.qutrit measurements

* Added tests and comments

* Added TShift operation. Adding tests

* Added test file for qutrit non-param ops

* Added ternary clock operation

* Removed pylint comments

* Added pow method for shift

* Added TAdd, fixed comments

* Fixed docstrings

* Fixed docstring for TShift

* Fixed docstrings for TClock and default_qutrit

* Fixed docstring for _apply_tshift

* Cleaning up

* Added _apply_tadd

* Added TSWAP and _apply_tswap

* Added tests for TShift

* Added tests for TAdd

* Added tests for TSWAP

* Added tests: non-param ops to test_default_qutrit

* Update doc/releases/changelog-dev.md

Co-authored-by: antalszava <antalszava@gmail.com>

* Updated marginal probs documentation

* Minor changes

* Fixed tests to contain code in correct context

* Removed artefacts from other branch

* Minor change to changelog

* Update tests/test_qutrit_device.py

Co-authored-by: antalszava <antalszava@gmail.com>

* Changes to address PR review

* Updating tests

* Updated test_qutrit_device test_device_executions

* Refactoring

* Fixed sampling with counts. Added tests

* Added test for coverage

* Update tests/test_qutrit_device.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Reformatted test_qutrit_device.py

* Updated changelog

* Updated changelog

* Updated changelog

* Updated changelog

* Updated code to remove unused import

* Updated comments for TestSample

* Fixed merge issues with qutrit device tests

* Added dependency to default_qutrit

* Added test for TAdd matrix

* Added test matrix for TSWAP

* Reformatted

* Update pennylane/devices/default_qutrit.py

* Update pennylane/ops/qutrit/observables.py

* Update tests/devices/test_default_qutrit.py

* Minor changes to tidy up PR

* Reverted TClock eigenval change

* Update doc/releases/changelog-dev.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/non_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/non_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated expand_matrix() and added tests

* Removed old comment

* Updated doc-string for TClock

* Updated doc string of TClock

* Update pennylane/operation.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update changelog; edited comments in expand_matrix

* Updated TAdd docstring

* Update doc/releases/changelog-dev.md

Co-authored-by: antalszava <antalszava@gmail.com>

* Update doc/releases/changelog-dev.md

Co-authored-by: antalszava <antalszava@gmail.com>

* Update doc/releases/changelog-dev.md

Co-authored-by: antalszava <antalszava@gmail.com>

* Added doc string reference to paper

* Updated default.qutrit observables list

* Update default.qutrit tests

* Updated tests

* Removed expand_matrix changes

* Update doc/releases/changelog-dev.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Linting

* Apply suggestions from code review

* Partition device apply ops test case.

* Run black

* Fix pylint

* Update pennylane/devices/default_qutrit.py

* black and pylint

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_non_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated test_default_qutrit.py

* Updated _apply_tadd documentation

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Added TSWAP eigvals

* Update tests/ops/qutrit/test_qutrit_non_parametric_ops.py

* Update tests/ops/qutrit/test_qutrit_non_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: antalszava <antalszava@gmail.com>
Co-authored-by: Olivia Di Matteo <dimatteo.olivia@protonmail.com>
Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>
Co-authored-by: Romain Moyard <rmoyard@gmail.com>
antalszava added a commit that referenced this issue Sep 16, 2022
* draft

* more

* First working version

* fix a bug; shot vector Counts returns tuple; Autograd interface update

* test file

* single_measurement

* more tests

* test

* first multi-meas attempt

* multi_measures

* Update

* Update

* merge

* Update

* update

* Update

* Remove autograd_changes

* Comment

* Update

* Coverage

* Typo

* Add tests

* Move tests

* Revert autograd

* Unecessary change

* Solve issue

* Add statistics new

* Update tests/test_new_return_types.py

Co-authored-by: antalszava <antalszava@gmail.com>

* Update pennylane/_qubit_device.py

Co-authored-by: antalszava <antalszava@gmail.com>

* 📝 Update from review

Update documentation and fix a test

* ✅ Update test

Change the state shape requ

* ✨ QNode integration

Add the enable and disable function for return types

* ♻️ Remove global

Replace Global by a class

* [skip-ci]

* ✅ Add tests for QNode integration

* more test cases for probs and sample multi (proj; tensor product)

* more test cases for probs and sample multi (proj; tensor product)

* multi-measure: Counts tests

* test docstrings

* ✨ Support Autograd Jacobian

Allow to return a ragged array and use Jacobian

* adjust test

* no more is_sampled; probs sample with obs test

* probs and sample test

* ✨ All interface backprop Jacobian

Ragged for Autograd and TF // tuple for Jax and Torch

* ✅ Update tests

* more tests

* probs tests

* more more tests

* refactor

* refactor tests

* update cov; add vanilla counts test (xfail) for finite shots

* restore statistics docstring

* Update tests/test_new_return_types.py

* process counts for finite shots

* create shot_vec_statistics aux method

* Apply suggestions from code review

Co-authored-by: Romain Moyard <rmoyard@gmail.com>

* fix

* suggestion

* refactors

* revert to have squeeze in expval

* docstring and more tests

* Update pennylane/interfaces/execution.py

Co-authored-by: antalszava <antalszava@gmail.com>

* ✅ Add default mixed to tests

It required to change default mixed asarray

* 🐛 Bug introduced due to checking backprop

* ✅ Separate the tape and qnode tests

* ♻️ Refactor after review

* [Return-types #2] Refactor return types (shot vector cases) (#2815)

* draft

* more

* fix a bug; shot vector Counts returns tuple; Autograd interface update

* test file

* single_measurement

* more tests

* first multi-meas attempt

* multi_measures

* merge

* Update

* update

* Move tests

* Revert autograd

* Unecessary change

* Solve issue

* Add statistics new

* [skip-ci]

* more test cases for probs and sample multi (proj; tensor product)

* more test cases for probs and sample multi (proj; tensor product)

* multi-measure: Counts tests

* test docstrings

* adjust test

* no more is_sampled; probs sample with obs test

* probs and sample test

* more tests

* probs tests

* more more tests

* refactor

* refactor tests

* update cov; add vanilla counts test (xfail) for finite shots

* restore statistics docstring

* process counts for finite shots

* create shot_vec_statistics aux method

* Apply suggestions from code review

Co-authored-by: Romain Moyard <rmoyard@gmail.com>

* fix

* suggestion

* refactors

* revert to have squeeze in expval

* docstring and more tests

* move squeezing further up and leave comment

* explain

* parametrize over shots too

* comments

* parametrize

Co-authored-by: Romain Moyard <rmoyard@gmail.com>

* draft

* tidy

* draft

* new gradients test file

* new test

* test

* more testing using the original file

* no enable_return

* add active_return conditions

* [skip-ci]

* draft

* update file name

* more tests

* get involutory case

* more tests and uncomment rest of the execute_new logic (otherwise getting None values)

* no finite diff checks for now

* counts test

* state warnings (merge master remaining conflict resolution step)

* current param shift tests pass

* Hamiltonian tests

* more tests

* Remove previous return_types files

* Update pennylane/gradients/parameter_shift.py

Co-authored-by: Albert Mitjans <a.mitjanscoma@gmail.com>

* [skip ci]

* linting

* addressing comments

* insert adjoint fix logic

* explicit case for JAX

* refactor; [skip ci]

* test no warning for multi-measure probs and expval

* updates due to change in axes

* add a comment; [skip-ci]

* condition simplified

* refactor as suggested

* not covered logic removal

* linting, coverage

* no else required

* refactor as suggested

* some lines not yet covered

* comment test requiring Autograd interface changes; reset interfaces/autograd.py file

* revert execution.py file changes

* update comments

* simplify condition

* Update using the new convetion

* simplify new logic

* handle convert_like in aux func manually because we have tuples; no array conversion as it may create a ragged array

* Apply review comment wrt. zero_rep

* TODO comments for finite diff usages in the tests

* TODO comments for finite diff usages in the tests

* suggestions applied

Co-authored-by: Romain Moyard <rmoyard@gmail.com>
Co-authored-by: Albert Mitjans <a.mitjanscoma@gmail.com>
eddddddy added a commit that referenced this issue Oct 5, 2022
…3091)

* Update QNSPSA optimizer

* Remove unnecessary reshapes

Co-authored-by: Romain Moyard <rmoyard@gmail.com>
Co-authored-by: antalszava <antalszava@gmail.com>
AlbertMitjans added a commit that referenced this issue Oct 27, 2022
* feat (Operator): ✨ Add change_wires method.

* refactor (Operator): ♻️ Change name from change_wires to map_wires.

* Remove error

* change name

* feat (map_wires): ✨ Add top-level qml.map_wires function.

* Add tests

* Only check subset of wires present in Operator

* Add tests

* Add tests

* chore (changelog): ✏️ Add feature to changelog.

* More fixes

* More fixes

* Fix test

* Fix tests

* Revert

* Revert

* Update doc/releases/changelog-dev.md

Co-authored-by: Christina Lee <christina@xanadu.ai>

* Update changelog

* Add docs

* Improve changelog entry

* Use QuantumScript class.

* Add note to docstring

* Import warning

* Add more ops and measurements in test

* Update pennylane/ops/functions/map_wires.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

* Update pennylane/ops/functions/map_wires.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

* Update pennylane/ops/functions/map_wires.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

Co-authored-by: Christina Lee <christina@xanadu.ai>
AlbertMitjans added a commit that referenced this issue Nov 17, 2022
* Add process abstract method to MeasurementProcess class

* Add TODO comment.

* Add docstring

* Add process method to ClassicalShadow class

* Fix coverage

* Add process_state method

* Remove abstract

* Coverage

* Add StateMeasurement and SampleMeasurement classes

* Revert

* Add changelog entry

* Add changelog entry

* Add _MutualInfo class

* Fix test

* Small fix

* Address comments

* Add interface tests

* Change state type

* Change state type

* Add test

* Remove error

* Remove comment

* Add tests

* Use state.stype

* Use circuit()

* Cast wires to list
Jaybsoni added a commit that referenced this issue Dec 1, 2022
…PauliSentence` instance (PauliUtility #2) (#3389)

* Cleaned up prototype

* lint

* codefactor

* fix tests

* added more tests

* finished adding tests

* run CI

* codefactor

* bug fix

* another bug

* coverage

* Apply suggestions from code review

Co-authored-by: Christina Lee <christina@xanadu.ai>

* bug

* address comments

* Update pennylane/pauli/pauli_arithmetic.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

* codefactor

* fix bug

* fixed bug no warning raised

* run CI

* Update tests/math/test_multi_dispatch.py

* Update pennylane/pauli/pauli_arithmetic.py

Co-authored-by: Albert Mitjans <a.mitjanscoma@gmail.com>

* Update tests/pauli/test_pauli_arithmetic.py

Co-authored-by: Albert Mitjans <a.mitjanscoma@gmail.com>

* addressed code review comments

* update init

* added test

* added utility functions

* fixed wire_order bug

* use single dispatch

* clean up + error message

* dont need to check for linear combination pauli words

* lint

* update useage of decompose in PL

* utils test done

* added tests for operation and hamiltonian

* lint

* typo

* tests for conversion

* typo

* lint

* had to move imports in exp.py

* lint

* Update pennylane/pauli/conversion.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

* Apply suggestions from code review

Co-authored-by: Christina Lee <christina@xanadu.ai>

* code factor

* codefactor

* lint + codefactor

* codefactor

* lint

* fixed old bug

* add test for hamiltonians

* Update pennylane/tape/tape.py

* update changelog

* isolated pauli_sentence

* fix utils

* fix circular import

* fix typo in return

* unused imports

* fix return types

* pylint bug

* fix attribute error

* Add pylint disable

* code factor

* lint

* added docstring

* Update doc/releases/changelog-dev.md

* added test for coverage

* Update pennylane/pauli/utils.py

Co-authored-by: Albert Mitjans <a.mitjanscoma@gmail.com>

* address code review comments

* fix tensor edge case

* lint + codefactor

* Update pennylane/pauli/pauli_arithmetic.py

* CI

Co-authored-by: Christina Lee <christina@xanadu.ai>
Co-authored-by: Albert Mitjans <a.mitjanscoma@gmail.com>
mudit2812 added a commit that referenced this issue May 23, 2023
* Adding tests for tensor observables

* Added tests for tensor sample

* Updated tests

* Apply suggestions from code review

* Partition device apply ops test case.

* Run black

* Fix pylint

* Update pennylane/devices/default_qutrit.py

* black and pylint

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_non_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated test_default_qutrit.py

* Updated _apply_tadd documentation

* Added eigvals method for TSWAP

* Reverted TSWAP eigval changes

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Added TSWAP eigvals

* Updated changelog-dev.md to include GellMannObs

* Removed empty file

* Added linting comments

* Updated tests to use gate_data

* Updated test parameter names to be more accurate

* Remove unused file

* Updated GellMannObs doc-string

* Update changelog-dev.md

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Added changes to GellMann to address PR comments

* Updated test

* Reformatting

* Trying out changes to Gell-Mann docstring

* Updated Changelog

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Testing LaTeX align

* Added non-diag tests

* Added diag, complex case for tensor sample

* Added example to doc string

* Fixed label test

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Added tests for controlled qutrit unitary

* Fix broadcasting, finish tests for CQutritUnitary

* Added TRX and created skeleton files

* Adding tests for TRX

* Fixed broadcasting issue in controlled qutrit unitary

* Fixed broadcasting issue with ControlledQutritUnitary

* Fixed broadcasting issue in TRX

* Updated TRX documentation

* Added tests

* Added tests for TRX

* Removed unused imports

* Removed unused imports, linting changes

* Added TRX parameter frequencies

* Updated matrix dtype for TRX generator

* Added test for param frequencies

* Added param-shift capability for qutrit devices

* Updated changelog

* Update changelog

* Added change for TRX generator

* Updated utils.py to support higher dimensions

* Added tests for updated utils.sparse_hamiltonian

* Added Identity as supported obs

* Updated TRX docstring

* Update tests/ops/qutrit/test_qutrit_non_parametric_ops.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Added ControlledQutritUnitary

* Update changelog-dev.md

* Removed empty files

* Update tests/ops/qutrit/test_qutrit_matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated to address PR

* Fixed uncommented lines in test suite

* Added complex values to state

* Updated test_mixed_polarity_controls

* Fixed QutritUnitary._controlled

* Updated test_controlled for matrix ops

* Updated ControlledQutritUnitary._controlled

* Reformatting

* Update pennylane/ops/qutrit/matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated ControlledQutritUnitary and tests

* Addressing PR review

* Updated sparse_hamiltonian, fixed TRX docstring

* Addressing PR review

* Refactoring

* Fixed changelog

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/test_qnode.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Reverted changes to sparse_hamiltonian

* Fixed sparse_hamiltonian test

* Updated changelog

* Updated TRX documentation

* Fixed generator

* Adding levels to sparse_hamiltonian

* Updated test sparse hamiltonian

* Fixed sparse hamiltonian test

* Fixed constant level kwarg

* Updated changelog, added test coverage

* Fixed coverage

* Updated test suite

* Updated files to address PR review

* Updated tests to include subspace error tests

* Added TRX tests for parameter shift

* Update doc/releases/changelog-dev.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/utils.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update utils.py to remove trailing whitespace

* Updated to address PR review

* Fixed class/object confusion bug

* Testing changes to adjust lines changed in PR

* Fixing changes

* Fixing changes

* Resetting problem files

* Fixing changes

* updated TRX docs

* Fixed TRX docs

* Updated TRX docs

* Fixed PR too many lines changed issue

* Updated subspace error tests

* Tweaked THadamard docs to fix rendering

* Test dos2unix

* Fixed subspace testing

* Merge changes

* Started adding tests for grad

* Updated tests to parametrize diff-method

* Linted tests

* Fiex tests using in-place inversion

* Added diff tests

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Fixed formatting

* Update pennylane/utils.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated TRY and tests

* Updated utils.py

* Fixed TRX generator

* Updated generator TRY

* Updated subspace validation for TRY

* Updated subspace validation

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Matthew Silverman <ma.silv11@gmail.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Matthew Silverman <ma.silv11@gmail.com>

* Reverted `validate_subspace` changes

* Updated test

* Added parameter shift test

* Fixed test

* Update doc/releases/changelog-dev.md

* Update changelog

* Updated grad tests

* Apply suggestions from code review

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated subspace docstring

---------

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <dimatteo.olivia@protonmail.com>
Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>
Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>
Co-authored-by: Matthew Silverman <ma.silv11@gmail.com>
frederikwilde pushed a commit that referenced this issue May 25, 2023
* Adding tests for tensor observables

* Added tests for tensor sample

* Updated tests

* Apply suggestions from code review

* Partition device apply ops test case.

* Run black

* Fix pylint

* Update pennylane/devices/default_qutrit.py

* black and pylint

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_non_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated test_default_qutrit.py

* Updated _apply_tadd documentation

* Added eigvals method for TSWAP

* Reverted TSWAP eigval changes

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Added TSWAP eigvals

* Updated changelog-dev.md to include GellMannObs

* Removed empty file

* Added linting comments

* Updated tests to use gate_data

* Updated test parameter names to be more accurate

* Remove unused file

* Updated GellMannObs doc-string

* Update changelog-dev.md

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Added changes to GellMann to address PR comments

* Updated test

* Reformatting

* Trying out changes to Gell-Mann docstring

* Updated Changelog

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Testing LaTeX align

* Added non-diag tests

* Added diag, complex case for tensor sample

* Added example to doc string

* Fixed label test

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Added tests for controlled qutrit unitary

* Fix broadcasting, finish tests for CQutritUnitary

* Added TRX and created skeleton files

* Adding tests for TRX

* Fixed broadcasting issue in controlled qutrit unitary

* Fixed broadcasting issue with ControlledQutritUnitary

* Fixed broadcasting issue in TRX

* Updated TRX documentation

* Added tests

* Added tests for TRX

* Removed unused imports

* Removed unused imports, linting changes

* Added TRX parameter frequencies

* Updated matrix dtype for TRX generator

* Added test for param frequencies

* Added param-shift capability for qutrit devices

* Updated changelog

* Update changelog

* Added change for TRX generator

* Updated utils.py to support higher dimensions

* Added tests for updated utils.sparse_hamiltonian

* Added Identity as supported obs

* Updated TRX docstring

* Update tests/ops/qutrit/test_qutrit_non_parametric_ops.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Added ControlledQutritUnitary

* Update changelog-dev.md

* Removed empty files

* Update tests/ops/qutrit/test_qutrit_matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated to address PR

* Fixed uncommented lines in test suite

* Added complex values to state

* Updated test_mixed_polarity_controls

* Fixed QutritUnitary._controlled

* Updated test_controlled for matrix ops

* Updated ControlledQutritUnitary._controlled

* Reformatting

* Update pennylane/ops/qutrit/matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated ControlledQutritUnitary and tests

* Addressing PR review

* Updated sparse_hamiltonian, fixed TRX docstring

* Addressing PR review

* Refactoring

* Fixed changelog

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/test_qnode.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Reverted changes to sparse_hamiltonian

* Fixed sparse_hamiltonian test

* Updated changelog

* Updated TRX documentation

* Fixed generator

* Adding levels to sparse_hamiltonian

* Updated test sparse hamiltonian

* Fixed sparse hamiltonian test

* Fixed constant level kwarg

* Updated changelog, added test coverage

* Fixed coverage

* Updated test suite

* Updated files to address PR review

* Updated tests to include subspace error tests

* Added TRX tests for parameter shift

* Update doc/releases/changelog-dev.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/utils.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update utils.py to remove trailing whitespace

* Updated to address PR review

* Fixed class/object confusion bug

* Testing changes to adjust lines changed in PR

* Fixing changes

* Fixing changes

* Resetting problem files

* Fixing changes

* updated TRX docs

* Fixed TRX docs

* Updated TRX docs

* Fixed PR too many lines changed issue

* Updated subspace error tests

* Tweaked THadamard docs to fix rendering

* Test dos2unix

* Fixed subspace testing

* Merge changes

* Started adding tests for grad

* Updated tests to parametrize diff-method

* Linted tests

* Fiex tests using in-place inversion

* Added diff tests

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Fixed formatting

* Update pennylane/utils.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated TRY and tests

* Updated utils.py

* Fixed TRX generator

* Updated generator TRY

* Updated subspace validation for TRY

* Updated subspace validation

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Matthew Silverman <ma.silv11@gmail.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Matthew Silverman <ma.silv11@gmail.com>

* Reverted `validate_subspace` changes

* Updated test

* Added parameter shift test

* Fixed test

* Update doc/releases/changelog-dev.md

* Update changelog

* Updated grad tests

* Apply suggestions from code review

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated subspace docstring

---------

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <dimatteo.olivia@protonmail.com>
Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>
Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>
Co-authored-by: Matthew Silverman <ma.silv11@gmail.com>
rmoyard added a commit that referenced this issue Jun 14, 2023
* Draft dispatcher

* Second draft structure with dispatcher

* Changes on QNode

* More transforms in tests

* Update

* More tests

* Update documentation

* Qfunc special case

* More tests

* Remove el

* Coverage

* Coverage fix

* Typo

* Move qnode

* Draft program added

* Add is_informative

* Update pennylane/transforms/core/transform_dispatcher.py

Co-authored-by: BorjaRequena <59647767+BorjaRequena@users.noreply.github.com>

* Update pennylane/transforms/core/transform_dispatcher.py

Co-authored-by: BorjaRequena <59647767+BorjaRequena@users.noreply.github.com>

* Update pennylane/transforms/core/transform_dispatcher.py

Co-authored-by: BorjaRequena <59647767+BorjaRequena@users.noreply.github.com>

* Update pennylane/transforms/core/transform_dispatcher.py

Co-authored-by: BorjaRequena <59647767+BorjaRequena@users.noreply.github.com>

* Update pennylane/transforms/core/transform_dispatcher.py

Co-authored-by: BorjaRequena <59647767+BorjaRequena@users.noreply.github.com>

* Update pennylane/transforms/core/transform_dispatcher.py

Co-authored-by: BorjaRequena <59647767+BorjaRequena@users.noreply.github.com>

* Review update

* Doc

* Separate transform and dispatcher

* More from review

* Black Pylint

* Tests and doc

* Update for python 3.8

* Pylint

* Pylint

* Update tests/transforms/test_experimental/test_transform_dispatcher.py

Co-authored-by: BorjaRequena <59647767+BorjaRequena@users.noreply.github.com>

* Update tests/transforms/test_experimental/test_transform_dispatcher.py

Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>

* Pylint

* Not in place

* Only deepcopy the first qnode

* Copy only first qnode

* Changelog

* Changelog

* Changelog

* Review

* Pylint

* Typo

* Remove one comment

* Add warnings in qnode

* Black

---------

Co-authored-by: BorjaRequena <59647767+BorjaRequena@users.noreply.github.com>
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
frederikwilde added a commit that referenced this issue Aug 15, 2023
* Change seed setting in spsa_grad.

* Update changelog.

* Adapt tests. Note that lots of tests still set a global seed!

* Update pennylane/gradients/spsa_gradient.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

* Update pennylane/gradients/spsa_gradient.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

* use Shots class in gradients module (#4152)

* linting

* add num_copies property to shots

* change gradients to use new Shots class

* fix missing update in vjp

* fix stacking and single-shots in shot_adaptive

* remove unneeded cast to tuple

* type-hints and touch-ups

* code review feedback

* changelog

---------

Co-authored-by: Romain Moyard <rmoyard@gmail.com>

* Qutrit Rotations #2 (TRY) (#2846)

* Adding tests for tensor observables

* Added tests for tensor sample

* Updated tests

* Apply suggestions from code review

* Partition device apply ops test case.

* Run black

* Fix pylint

* Update pennylane/devices/default_qutrit.py

* black and pylint

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_non_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated test_default_qutrit.py

* Updated _apply_tadd documentation

* Added eigvals method for TSWAP

* Reverted TSWAP eigval changes

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Added TSWAP eigvals

* Updated changelog-dev.md to include GellMannObs

* Removed empty file

* Added linting comments

* Updated tests to use gate_data

* Updated test parameter names to be more accurate

* Remove unused file

* Updated GellMannObs doc-string

* Update changelog-dev.md

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Added changes to GellMann to address PR comments

* Updated test

* Reformatting

* Trying out changes to Gell-Mann docstring

* Updated Changelog

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Testing LaTeX align

* Added non-diag tests

* Added diag, complex case for tensor sample

* Added example to doc string

* Fixed label test

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Added tests for controlled qutrit unitary

* Fix broadcasting, finish tests for CQutritUnitary

* Added TRX and created skeleton files

* Adding tests for TRX

* Fixed broadcasting issue in controlled qutrit unitary

* Fixed broadcasting issue with ControlledQutritUnitary

* Fixed broadcasting issue in TRX

* Updated TRX documentation

* Added tests

* Added tests for TRX

* Removed unused imports

* Removed unused imports, linting changes

* Added TRX parameter frequencies

* Updated matrix dtype for TRX generator

* Added test for param frequencies

* Added param-shift capability for qutrit devices

* Updated changelog

* Update changelog

* Added change for TRX generator

* Updated utils.py to support higher dimensions

* Added tests for updated utils.sparse_hamiltonian

* Added Identity as supported obs

* Updated TRX docstring

* Update tests/ops/qutrit/test_qutrit_non_parametric_ops.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Added ControlledQutritUnitary

* Update changelog-dev.md

* Removed empty files

* Update tests/ops/qutrit/test_qutrit_matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated to address PR

* Fixed uncommented lines in test suite

* Added complex values to state

* Updated test_mixed_polarity_controls

* Fixed QutritUnitary._controlled

* Updated test_controlled for matrix ops

* Updated ControlledQutritUnitary._controlled

* Reformatting

* Update pennylane/ops/qutrit/matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated ControlledQutritUnitary and tests

* Addressing PR review

* Updated sparse_hamiltonian, fixed TRX docstring

* Addressing PR review

* Refactoring

* Fixed changelog

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/test_qnode.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Reverted changes to sparse_hamiltonian

* Fixed sparse_hamiltonian test

* Updated changelog

* Updated TRX documentation

* Fixed generator

* Adding levels to sparse_hamiltonian

* Updated test sparse hamiltonian

* Fixed sparse hamiltonian test

* Fixed constant level kwarg

* Updated changelog, added test coverage

* Fixed coverage

* Updated test suite

* Updated files to address PR review

* Updated tests to include subspace error tests

* Added TRX tests for parameter shift

* Update doc/releases/changelog-dev.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/utils.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update utils.py to remove trailing whitespace

* Updated to address PR review

* Fixed class/object confusion bug

* Testing changes to adjust lines changed in PR

* Fixing changes

* Fixing changes

* Resetting problem files

* Fixing changes

* updated TRX docs

* Fixed TRX docs

* Updated TRX docs

* Fixed PR too many lines changed issue

* Updated subspace error tests

* Tweaked THadamard docs to fix rendering

* Test dos2unix

* Fixed subspace testing

* Merge changes

* Started adding tests for grad

* Updated tests to parametrize diff-method

* Linted tests

* Fiex tests using in-place inversion

* Added diff tests

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Fixed formatting

* Update pennylane/utils.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated TRY and tests

* Updated utils.py

* Fixed TRX generator

* Updated generator TRY

* Updated subspace validation for TRY

* Updated subspace validation

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Matthew Silverman <ma.silv11@gmail.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Matthew Silverman <ma.silv11@gmail.com>

* Reverted `validate_subspace` changes

* Updated test

* Added parameter shift test

* Fixed test

* Update doc/releases/changelog-dev.md

* Update changelog

* Updated grad tests

* Apply suggestions from code review

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated subspace docstring

---------

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <dimatteo.olivia@protonmail.com>
Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>
Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>
Co-authored-by: Matthew Silverman <ma.silv11@gmail.com>

* jax integration for for DefaultQubit2 (#4137)

* copy-paste autograd test file

* port to jax in tests; update shots in jax interface

* add argnums when needed; skip tests that do not work with jax

* use pytest imports to skip

* pylint tests

* changelog

* take shots change from Christina's PR

* Update doc/releases/changelog-dev.md

Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>

* copy changes to autograd as well

* rename to indicate bool; slight autograd fixup

---------

Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>

* Treat identities as equivalent in `pauli.are_identical_pauli_words` (#4161)

* fix hamiltonian grouping indices bug

* Update doc/releases/changelog-dev.md

* Take wire ordering in the `wires` argument to `qml.density_matrix` into account (#4072)

* include wire ordering, test for that, raise error for broadcasting, test for that

* reduce

* changelog

* add test for qinfo transform

* more tests for math module

* lint math tests

* lint

* black

* introduce, use and test input_is_dm kwarg to reduced_dm

* tmp

* reverting

* seed fix

---------

Co-authored-by: Edward Jiang <34989448+eddddddy@users.noreply.github.com>

* CY inherits from ControlledOp (#4116)

`qml.CY` has been moved from `qml.ops.qubit.non_parametric_ops` to `qml.ops.op_math.controlled_ops`
  and now inherits from `qml.ops.op_math.ControlledOp`.
---------
Co-authored-by: Matthew Silverman <matthews@xanadu.ai>
Co-authored-by: Christina Lee <christina@xanadu.ai>

* Empty hamiltonians are compatible with `qml.pauli_sentence()` (#4171)

* fix ps rep for empty hamiltonian

* changelog

* Update doc/releases/changelog-dev.md

Co-authored-by: Utkarsh <utkarshazad98@gmail.com>

---------

Co-authored-by: Utkarsh <utkarshazad98@gmail.com>

* Update tests/interfaces/test_torch_qnode.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

* Python 3.8 compatibility and increase num_directions, since spsa_grad, with num_directions=1, fails sometimes, depending on the seed.

* Fix failing tests

* Fix docs.

* Fix unsupported NoneType import

* Undo irrelevant change.

* Fix failing tests. Still not reliable.

* Fix tolerance issue with SPSA second derivative.

* Increase tolerance. This test has also been failing spontaneously on the master branch 3468885

* Switch to sampler_rng kwarg and fix tolerance issues.

* More migration to sampler_rng

* Migrate more tests to sampler_rng

* Migrate legacy tests to sampler_rng

* black

* Deprecated the sampler_seed argument

* black

* Increase tolerance for test_hamiltonian_expansion_finite_shots tests.

* Fix tol

* Pin autoray for CI

* Set num_directions=20 in all hamiltonian_expansion_finite_shots tests.

* Make black and pylint happy

* Set device seed for DQ2 tests.

* Add tests for new return type system.

* Fix bug

* Adapt dq2 tests for spsa

* Remove qml.disable_return()

* Change DQ2 tests to new seed setting system.

* Fix bug

* Fix failing tests. TF tests pass locally. Not sure what the problem is.

* Fix missing grad_kwarg

* black

* Increase tol

* Increase num_directions

* Apply suggestions from code review

Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>

* Update pennylane/gradients/spsa_gradient.py

Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>

* Copy TestRademacherSampler into new tests

* Make docs more precise and add tests for rng kwarg of samplers.

* black

* black

* Fix error message in _spsa_grad_legacy

* pylint

* Update changelog-dev.md

* black

* Increase num_directions for Hessian test.

---------

Co-authored-by: Christina Lee <christina@xanadu.ai>
Co-authored-by: Matthew Silverman <matthews@xanadu.ai>
Co-authored-by: Romain Moyard <rmoyard@gmail.com>
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <dimatteo.olivia@protonmail.com>
Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>
Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>
Co-authored-by: Matthew Silverman <ma.silv11@gmail.com>
Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>
Co-authored-by: Edward Jiang <34989448+eddddddy@users.noreply.github.com>
Co-authored-by: Utkarsh <utkarshazad98@gmail.com>
ludmilaasb pushed a commit to ludmilaasb/pennylane that referenced this issue Aug 15, 2023
* Change seed setting in spsa_grad.

* Update changelog.

* Adapt tests. Note that lots of tests still set a global seed!

* Update pennylane/gradients/spsa_gradient.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

* Update pennylane/gradients/spsa_gradient.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

* use Shots class in gradients module (PennyLaneAI#4152)

* linting

* add num_copies property to shots

* change gradients to use new Shots class

* fix missing update in vjp

* fix stacking and single-shots in shot_adaptive

* remove unneeded cast to tuple

* type-hints and touch-ups

* code review feedback

* changelog

---------

Co-authored-by: Romain Moyard <rmoyard@gmail.com>

* Qutrit Rotations PennyLaneAI#2 (TRY) (PennyLaneAI#2846)

* Adding tests for tensor observables

* Added tests for tensor sample

* Updated tests

* Apply suggestions from code review

* Partition device apply ops test case.

* Run black

* Fix pylint

* Update pennylane/devices/default_qutrit.py

* black and pylint

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_non_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated test_default_qutrit.py

* Updated _apply_tadd documentation

* Added eigvals method for TSWAP

* Reverted TSWAP eigval changes

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Added TSWAP eigvals

* Updated changelog-dev.md to include GellMannObs

* Removed empty file

* Added linting comments

* Updated tests to use gate_data

* Updated test parameter names to be more accurate

* Remove unused file

* Updated GellMannObs doc-string

* Update changelog-dev.md

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Added changes to GellMann to address PR comments

* Updated test

* Reformatting

* Trying out changes to Gell-Mann docstring

* Updated Changelog

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Testing LaTeX align

* Added non-diag tests

* Added diag, complex case for tensor sample

* Added example to doc string

* Fixed label test

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Added tests for controlled qutrit unitary

* Fix broadcasting, finish tests for CQutritUnitary

* Added TRX and created skeleton files

* Adding tests for TRX

* Fixed broadcasting issue in controlled qutrit unitary

* Fixed broadcasting issue with ControlledQutritUnitary

* Fixed broadcasting issue in TRX

* Updated TRX documentation

* Added tests

* Added tests for TRX

* Removed unused imports

* Removed unused imports, linting changes

* Added TRX parameter frequencies

* Updated matrix dtype for TRX generator

* Added test for param frequencies

* Added param-shift capability for qutrit devices

* Updated changelog

* Update changelog

* Added change for TRX generator

* Updated utils.py to support higher dimensions

* Added tests for updated utils.sparse_hamiltonian

* Added Identity as supported obs

* Updated TRX docstring

* Update tests/ops/qutrit/test_qutrit_non_parametric_ops.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Added ControlledQutritUnitary

* Update changelog-dev.md

* Removed empty files

* Update tests/ops/qutrit/test_qutrit_matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated to address PR

* Fixed uncommented lines in test suite

* Added complex values to state

* Updated test_mixed_polarity_controls

* Fixed QutritUnitary._controlled

* Updated test_controlled for matrix ops

* Updated ControlledQutritUnitary._controlled

* Reformatting

* Update pennylane/ops/qutrit/matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated ControlledQutritUnitary and tests

* Addressing PR review

* Updated sparse_hamiltonian, fixed TRX docstring

* Addressing PR review

* Refactoring

* Fixed changelog

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/test_qnode.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Reverted changes to sparse_hamiltonian

* Fixed sparse_hamiltonian test

* Updated changelog

* Updated TRX documentation

* Fixed generator

* Adding levels to sparse_hamiltonian

* Updated test sparse hamiltonian

* Fixed sparse hamiltonian test

* Fixed constant level kwarg

* Updated changelog, added test coverage

* Fixed coverage

* Updated test suite

* Updated files to address PR review

* Updated tests to include subspace error tests

* Added TRX tests for parameter shift

* Update doc/releases/changelog-dev.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/utils.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update utils.py to remove trailing whitespace

* Updated to address PR review

* Fixed class/object confusion bug

* Testing changes to adjust lines changed in PR

* Fixing changes

* Fixing changes

* Resetting problem files

* Fixing changes

* updated TRX docs

* Fixed TRX docs

* Updated TRX docs

* Fixed PR too many lines changed issue

* Updated subspace error tests

* Tweaked THadamard docs to fix rendering

* Test dos2unix

* Fixed subspace testing

* Merge changes

* Started adding tests for grad

* Updated tests to parametrize diff-method

* Linted tests

* Fiex tests using in-place inversion

* Added diff tests

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Fixed formatting

* Update pennylane/utils.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated TRY and tests

* Updated utils.py

* Fixed TRX generator

* Updated generator TRY

* Updated subspace validation for TRY

* Updated subspace validation

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Matthew Silverman <ma.silv11@gmail.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Matthew Silverman <ma.silv11@gmail.com>

* Reverted `validate_subspace` changes

* Updated test

* Added parameter shift test

* Fixed test

* Update doc/releases/changelog-dev.md

* Update changelog

* Updated grad tests

* Apply suggestions from code review

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated subspace docstring

---------

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <dimatteo.olivia@protonmail.com>
Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>
Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>
Co-authored-by: Matthew Silverman <ma.silv11@gmail.com>

* jax integration for for DefaultQubit2 (PennyLaneAI#4137)

* copy-paste autograd test file

* port to jax in tests; update shots in jax interface

* add argnums when needed; skip tests that do not work with jax

* use pytest imports to skip

* pylint tests

* changelog

* take shots change from Christina's PR

* Update doc/releases/changelog-dev.md

Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>

* copy changes to autograd as well

* rename to indicate bool; slight autograd fixup

---------

Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>

* Treat identities as equivalent in `pauli.are_identical_pauli_words` (PennyLaneAI#4161)

* fix hamiltonian grouping indices bug

* Update doc/releases/changelog-dev.md

* Take wire ordering in the `wires` argument to `qml.density_matrix` into account (PennyLaneAI#4072)

* include wire ordering, test for that, raise error for broadcasting, test for that

* reduce

* changelog

* add test for qinfo transform

* more tests for math module

* lint math tests

* lint

* black

* introduce, use and test input_is_dm kwarg to reduced_dm

* tmp

* reverting

* seed fix

---------

Co-authored-by: Edward Jiang <34989448+eddddddy@users.noreply.github.com>

* CY inherits from ControlledOp (PennyLaneAI#4116)

`qml.CY` has been moved from `qml.ops.qubit.non_parametric_ops` to `qml.ops.op_math.controlled_ops`
  and now inherits from `qml.ops.op_math.ControlledOp`.
---------
Co-authored-by: Matthew Silverman <matthews@xanadu.ai>
Co-authored-by: Christina Lee <christina@xanadu.ai>

* Empty hamiltonians are compatible with `qml.pauli_sentence()` (PennyLaneAI#4171)

* fix ps rep for empty hamiltonian

* changelog

* Update doc/releases/changelog-dev.md

Co-authored-by: Utkarsh <utkarshazad98@gmail.com>

---------

Co-authored-by: Utkarsh <utkarshazad98@gmail.com>

* Update tests/interfaces/test_torch_qnode.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

* Python 3.8 compatibility and increase num_directions, since spsa_grad, with num_directions=1, fails sometimes, depending on the seed.

* Fix failing tests

* Fix docs.

* Fix unsupported NoneType import

* Undo irrelevant change.

* Fix failing tests. Still not reliable.

* Fix tolerance issue with SPSA second derivative.

* Increase tolerance. This test has also been failing spontaneously on the master branch 3468885

* Switch to sampler_rng kwarg and fix tolerance issues.

* More migration to sampler_rng

* Migrate more tests to sampler_rng

* Migrate legacy tests to sampler_rng

* black

* Deprecated the sampler_seed argument

* black

* Increase tolerance for test_hamiltonian_expansion_finite_shots tests.

* Fix tol

* Pin autoray for CI

* Set num_directions=20 in all hamiltonian_expansion_finite_shots tests.

* Make black and pylint happy

* Set device seed for DQ2 tests.

* Add tests for new return type system.

* Fix bug

* Adapt dq2 tests for spsa

* Remove qml.disable_return()

* Change DQ2 tests to new seed setting system.

* Fix bug

* Fix failing tests. TF tests pass locally. Not sure what the problem is.

* Fix missing grad_kwarg

* black

* Increase tol

* Increase num_directions

* Apply suggestions from code review

Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>

* Update pennylane/gradients/spsa_gradient.py

Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>

* Copy TestRademacherSampler into new tests

* Make docs more precise and add tests for rng kwarg of samplers.

* black

* black

* Fix error message in _spsa_grad_legacy

* pylint

* Update changelog-dev.md

* black

* Increase num_directions for Hessian test.

---------

Co-authored-by: Christina Lee <christina@xanadu.ai>
Co-authored-by: Matthew Silverman <matthews@xanadu.ai>
Co-authored-by: Romain Moyard <rmoyard@gmail.com>
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <dimatteo.olivia@protonmail.com>
Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>
Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>
Co-authored-by: Matthew Silverman <ma.silv11@gmail.com>
Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>
Co-authored-by: Edward Jiang <34989448+eddddddy@users.noreply.github.com>
Co-authored-by: Utkarsh <utkarshazad98@gmail.com>
mlxd pushed a commit that referenced this issue Aug 23, 2023
* Change seed setting in spsa_grad.

* Update changelog.

* Adapt tests. Note that lots of tests still set a global seed!

* Update pennylane/gradients/spsa_gradient.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

* Update pennylane/gradients/spsa_gradient.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

* use Shots class in gradients module (#4152)

* linting

* add num_copies property to shots

* change gradients to use new Shots class

* fix missing update in vjp

* fix stacking and single-shots in shot_adaptive

* remove unneeded cast to tuple

* type-hints and touch-ups

* code review feedback

* changelog

---------

Co-authored-by: Romain Moyard <rmoyard@gmail.com>

* Qutrit Rotations #2 (TRY) (#2846)

* Adding tests for tensor observables

* Added tests for tensor sample

* Updated tests

* Apply suggestions from code review

* Partition device apply ops test case.

* Run black

* Fix pylint

* Update pennylane/devices/default_qutrit.py

* black and pylint

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_non_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated test_default_qutrit.py

* Updated _apply_tadd documentation

* Added eigvals method for TSWAP

* Reverted TSWAP eigval changes

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Added TSWAP eigvals

* Updated changelog-dev.md to include GellMannObs

* Removed empty file

* Added linting comments

* Updated tests to use gate_data

* Updated test parameter names to be more accurate

* Remove unused file

* Updated GellMannObs doc-string

* Update changelog-dev.md

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Added changes to GellMann to address PR comments

* Updated test

* Reformatting

* Trying out changes to Gell-Mann docstring

* Updated Changelog

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Testing LaTeX align

* Added non-diag tests

* Added diag, complex case for tensor sample

* Added example to doc string

* Fixed label test

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/devices/test_default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Added tests for controlled qutrit unitary

* Fix broadcasting, finish tests for CQutritUnitary

* Added TRX and created skeleton files

* Adding tests for TRX

* Fixed broadcasting issue in controlled qutrit unitary

* Fixed broadcasting issue with ControlledQutritUnitary

* Fixed broadcasting issue in TRX

* Updated TRX documentation

* Added tests

* Added tests for TRX

* Removed unused imports

* Removed unused imports, linting changes

* Added TRX parameter frequencies

* Updated matrix dtype for TRX generator

* Added test for param frequencies

* Added param-shift capability for qutrit devices

* Updated changelog

* Update changelog

* Added change for TRX generator

* Updated utils.py to support higher dimensions

* Added tests for updated utils.sparse_hamiltonian

* Added Identity as supported obs

* Updated TRX docstring

* Update tests/ops/qutrit/test_qutrit_non_parametric_ops.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Update pennylane/ops/qutrit/observables.py

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>

* Added ControlledQutritUnitary

* Update changelog-dev.md

* Removed empty files

* Update tests/ops/qutrit/test_qutrit_matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated to address PR

* Fixed uncommented lines in test suite

* Added complex values to state

* Updated test_mixed_polarity_controls

* Fixed QutritUnitary._controlled

* Updated test_controlled for matrix ops

* Updated ControlledQutritUnitary._controlled

* Reformatting

* Update pennylane/ops/qutrit/matrix_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated ControlledQutritUnitary and tests

* Addressing PR review

* Updated sparse_hamiltonian, fixed TRX docstring

* Addressing PR review

* Refactoring

* Fixed changelog

* Update pennylane/devices/default_qutrit.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/test_qnode.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Reverted changes to sparse_hamiltonian

* Fixed sparse_hamiltonian test

* Updated changelog

* Updated TRX documentation

* Fixed generator

* Adding levels to sparse_hamiltonian

* Updated test sparse hamiltonian

* Fixed sparse hamiltonian test

* Fixed constant level kwarg

* Updated changelog, added test coverage

* Fixed coverage

* Updated test suite

* Updated files to address PR review

* Updated tests to include subspace error tests

* Added TRX tests for parameter shift

* Update doc/releases/changelog-dev.md

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update pennylane/utils.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update utils.py to remove trailing whitespace

* Updated to address PR review

* Fixed class/object confusion bug

* Testing changes to adjust lines changed in PR

* Fixing changes

* Fixing changes

* Resetting problem files

* Fixing changes

* updated TRX docs

* Fixed TRX docs

* Updated TRX docs

* Fixed PR too many lines changed issue

* Updated subspace error tests

* Tweaked THadamard docs to fix rendering

* Test dos2unix

* Fixed subspace testing

* Merge changes

* Started adding tests for grad

* Updated tests to parametrize diff-method

* Linted tests

* Fiex tests using in-place inversion

* Added diff tests

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Update tests/ops/qutrit/test_qutrit_parametric_ops.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Fixed formatting

* Update pennylane/utils.py

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated TRY and tests

* Updated utils.py

* Fixed TRX generator

* Updated generator TRY

* Updated subspace validation for TRY

* Updated subspace validation

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Matthew Silverman <ma.silv11@gmail.com>

* Update pennylane/ops/qutrit/parametric_ops.py

Co-authored-by: Matthew Silverman <ma.silv11@gmail.com>

* Reverted `validate_subspace` changes

* Updated test

* Added parameter shift test

* Fixed test

* Update doc/releases/changelog-dev.md

* Update changelog

* Updated grad tests

* Apply suggestions from code review

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>

* Updated subspace docstring

---------

Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <dimatteo.olivia@protonmail.com>
Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>
Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>
Co-authored-by: Matthew Silverman <ma.silv11@gmail.com>

* jax integration for for DefaultQubit2 (#4137)

* copy-paste autograd test file

* port to jax in tests; update shots in jax interface

* add argnums when needed; skip tests that do not work with jax

* use pytest imports to skip

* pylint tests

* changelog

* take shots change from Christina's PR

* Update doc/releases/changelog-dev.md

Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>

* copy changes to autograd as well

* rename to indicate bool; slight autograd fixup

---------

Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>

* Treat identities as equivalent in `pauli.are_identical_pauli_words` (#4161)

* fix hamiltonian grouping indices bug

* Update doc/releases/changelog-dev.md

* Take wire ordering in the `wires` argument to `qml.density_matrix` into account (#4072)

* include wire ordering, test for that, raise error for broadcasting, test for that

* reduce

* changelog

* add test for qinfo transform

* more tests for math module

* lint math tests

* lint

* black

* introduce, use and test input_is_dm kwarg to reduced_dm

* tmp

* reverting

* seed fix

---------

Co-authored-by: Edward Jiang <34989448+eddddddy@users.noreply.github.com>

* CY inherits from ControlledOp (#4116)

`qml.CY` has been moved from `qml.ops.qubit.non_parametric_ops` to `qml.ops.op_math.controlled_ops`
  and now inherits from `qml.ops.op_math.ControlledOp`.
---------
Co-authored-by: Matthew Silverman <matthews@xanadu.ai>
Co-authored-by: Christina Lee <christina@xanadu.ai>

* Empty hamiltonians are compatible with `qml.pauli_sentence()` (#4171)

* fix ps rep for empty hamiltonian

* changelog

* Update doc/releases/changelog-dev.md

Co-authored-by: Utkarsh <utkarshazad98@gmail.com>

---------

Co-authored-by: Utkarsh <utkarshazad98@gmail.com>

* Update tests/interfaces/test_torch_qnode.py

Co-authored-by: Christina Lee <christina@xanadu.ai>

* Python 3.8 compatibility and increase num_directions, since spsa_grad, with num_directions=1, fails sometimes, depending on the seed.

* Fix failing tests

* Fix docs.

* Fix unsupported NoneType import

* Undo irrelevant change.

* Fix failing tests. Still not reliable.

* Fix tolerance issue with SPSA second derivative.

* Increase tolerance. This test has also been failing spontaneously on the master branch 3468885

* Switch to sampler_rng kwarg and fix tolerance issues.

* More migration to sampler_rng

* Migrate more tests to sampler_rng

* Migrate legacy tests to sampler_rng

* black

* Deprecated the sampler_seed argument

* black

* Increase tolerance for test_hamiltonian_expansion_finite_shots tests.

* Fix tol

* Pin autoray for CI

* Set num_directions=20 in all hamiltonian_expansion_finite_shots tests.

* Make black and pylint happy

* Set device seed for DQ2 tests.

* Add tests for new return type system.

* Fix bug

* Adapt dq2 tests for spsa

* Remove qml.disable_return()

* Change DQ2 tests to new seed setting system.

* Fix bug

* Fix failing tests. TF tests pass locally. Not sure what the problem is.

* Fix missing grad_kwarg

* black

* Increase tol

* Increase num_directions

* Apply suggestions from code review

Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>

* Update pennylane/gradients/spsa_gradient.py

Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>

* Copy TestRademacherSampler into new tests

* Make docs more precise and add tests for rng kwarg of samplers.

* black

* black

* Fix error message in _spsa_grad_legacy

* pylint

* Update changelog-dev.md

* black

* Increase num_directions for Hessian test.

---------

Co-authored-by: Christina Lee <christina@xanadu.ai>
Co-authored-by: Matthew Silverman <matthews@xanadu.ai>
Co-authored-by: Romain Moyard <rmoyard@gmail.com>
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <dimatteo.olivia@protonmail.com>
Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>
Co-authored-by: Christina Lee <chrissie.c.l@gmail.com>
Co-authored-by: Matthew Silverman <ma.silv11@gmail.com>
Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>
Co-authored-by: Edward Jiang <34989448+eddddddy@users.noreply.github.com>
Co-authored-by: Utkarsh <utkarshazad98@gmail.com>
Shiro-Raven added a commit that referenced this issue May 23, 2024


Co-authored-by: Christina Lee <christina@xanadu.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core :atom: Core functionality (Operations, QNodes, CircuitGraphs) devices 💻 Device or plugin API related documentation 📘 Documentation changes and updates enhancement ✨ New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants