Skip to content

Commit

Permalink
Merge branch 'master' into capture-transforms-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
mudit2812 authored Feb 13, 2025
2 parents 845fdd9 + 4444bac commit 3d02fd5
Show file tree
Hide file tree
Showing 97 changed files with 52,935 additions and 49,019 deletions.
56,541 changes: 28,436 additions & 28,105 deletions .github/durations/core_tests_durations.json

Large diffs are not rendered by default.

31,658 changes: 15,893 additions & 15,765 deletions .github/durations/jax_tests_durations.json

Large diffs are not rendered by default.

9,067 changes: 4,556 additions & 4,511 deletions .github/durations/tf_tests_durations.json

Large diffs are not rendered by default.

90 changes: 52 additions & 38 deletions .github/workflows/interface-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
default_runner: ubuntu-latest
force_large_runner: ${{ inputs.use_large_runner }}

disable-fail-fast-wae:
warnings-as-errors-setup:
needs:
- determine_runner

Expand All @@ -100,8 +100,22 @@ jobs:
run: |
echo "fail_fast=${{ contains(inputs.python_warning_level, 'default') && 'default' || 'error' }}" >> $GITHUB_OUTPUT
- name: Set pytest arguments for setting warnings level
id: pytest_warning_flags
env:
PYTEST_WARNING_ARGS: -W "${{ inputs.python_warning_level }}" --continue-on-collection-errors
run: |
if [ "${{ inputs.python_warning_level }}" != "default" ]; then
echo "Setting pytest warning flags"
echo "pytest_warning_args=$PYTEST_WARNING_ARGS" >> $GITHUB_OUTPUT
else
echo "No pytest warning flags needed"
echo "pytest_warning_args=" >> $GITHUB_OUTPUT
fi
outputs:
fail_fast: ${{ steps.mat_fail_fast.outputs.fail_fast }}
pytest_warning_args: ${{ steps.pytest_warning_flags.outputs.pytest_warning_args }}

setup-ci-load:
needs:
Expand All @@ -127,7 +141,7 @@ jobs:
then
cat >python_versions.json <<-EOF
{
"default": ["3.10"]
"default": ["3.10"]
}
EOF
else
Expand Down Expand Up @@ -215,9 +229,9 @@ jobs:
- setup-ci-load
- determine_runner
- default-dependency-versions
- disable-fail-fast-wae
- warnings-as-errors-setup
strategy:
fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }}
fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }}
max-parallel: >-
${{
fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).torch-tests
Expand All @@ -241,7 +255,7 @@ jobs:
${{ needs.default-dependency-versions.outputs.pytorch-version }}
${{ inputs.additional_python_packages }}
additional_pip_packages_post: ${{ needs.default-dependency-versions.outputs.pennylane-lightning-latest }}
pytest_additional_args: -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }}
pytest_additional_args: ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }}
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: torch and not qcut and not finite-diff and not param-shift
requirements_file: ${{ github.event_name == 'schedule' && strategy.job-index == 0 && 'torch.txt' || '' }}
Expand All @@ -252,9 +266,9 @@ jobs:
- setup-ci-load
- determine_runner
- default-dependency-versions
- disable-fail-fast-wae
- warnings-as-errors-setup
strategy:
fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }}
fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }}
max-parallel: >-
${{
fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).autograd-tests
Expand All @@ -277,7 +291,7 @@ jobs:
additional_pip_packages: ${{ inputs.additional_python_packages }}
additional_pip_packages_post: ${{ needs.default-dependency-versions.outputs.pennylane-lightning-latest }}
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_additional_args: -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }}
pytest_additional_args: ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }}
pytest_markers: autograd and not qcut and not finite-diff and not param-shift


Expand All @@ -286,9 +300,9 @@ jobs:
- setup-ci-load
- determine_runner
- default-dependency-versions
- disable-fail-fast-wae
- warnings-as-errors-setup
strategy:
fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }}
fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }}
max-parallel: >-
${{
fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).tf-tests
Expand All @@ -315,7 +329,7 @@ jobs:
additional_pip_packages_post: ${{ needs.default-dependency-versions.outputs.pennylane-lightning-latest }}
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: tf and not qcut and not finite-diff and not param-shift
pytest_additional_args: --splits 3 --group ${{ matrix.group }} -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }}
pytest_additional_args: --splits 3 --group ${{ matrix.group }} ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }}
pytest_durations_file_path: '.github/durations/tf_tests_durations.json'
requirements_file: ${{ github.event_name == 'schedule' && strategy.job-index == 0 && 'tf.txt' || '' }}

Expand All @@ -324,9 +338,9 @@ jobs:
- setup-ci-load
- determine_runner
- default-dependency-versions
- disable-fail-fast-wae
- warnings-as-errors-setup
strategy:
fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }}
fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }}
max-parallel: >-
${{
fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).jax-tests
Expand All @@ -353,7 +367,7 @@ jobs:
additional_pip_packages_post: ${{ needs.default-dependency-versions.outputs.pennylane-lightning-latest }}
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: jax and not qcut and not finite-diff and not param-shift
pytest_additional_args: --dist=loadscope --splits 4 --group ${{ matrix.group }} -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }}
pytest_additional_args: --dist=loadscope --splits 4 --group ${{ matrix.group }} ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }}
pytest_durations_file_path: '.github/durations/jax_tests_durations.json'
requirements_file: ${{ github.event_name == 'schedule' && strategy.job-index == 0 && 'jax.txt' || '' }}

Expand All @@ -363,9 +377,9 @@ jobs:
- setup-ci-load
- determine_runner
- default-dependency-versions
- disable-fail-fast-wae
- warnings-as-errors-setup
strategy:
fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }}
fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }}
max-parallel: >-
${{
fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).core-tests
Expand All @@ -390,7 +404,7 @@ jobs:
additional_pip_packages_post: ${{ needs.default-dependency-versions.outputs.pennylane-lightning-latest }}
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: core and not qcut and not finite-diff and not param-shift
pytest_additional_args: --splits 6 --group ${{ matrix.group }} -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }}
pytest_additional_args: --splits 6 --group ${{ matrix.group }} ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }}
pytest_durations_file_path: '.github/durations/core_tests_durations.json'
requirements_file: ${{ github.event_name == 'schedule' && strategy.job-index == 0 && 'core.txt' || '' }}

Expand All @@ -400,9 +414,9 @@ jobs:
- setup-ci-load
- determine_runner
- default-dependency-versions
- disable-fail-fast-wae
- warnings-as-errors-setup
strategy:
fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }}
fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }}
max-parallel: >-
${{
fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).all-interfaces-tests
Expand Down Expand Up @@ -430,7 +444,7 @@ jobs:
additional_pip_packages_post: ${{ needs.default-dependency-versions.outputs.pennylane-lightning-latest }}
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: all_interfaces
pytest_additional_args: -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }}
pytest_additional_args: ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }}
requirements_file: ${{ github.event_name == 'schedule' && strategy.job-index == 0 && 'all_interfaces.txt' || '' }}


Expand All @@ -439,9 +453,9 @@ jobs:
- setup-ci-load
- determine_runner
- default-dependency-versions
- disable-fail-fast-wae
- warnings-as-errors-setup
strategy:
fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }}
fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }}
max-parallel: >-
${{
fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).external-libraries-tests
Expand All @@ -463,7 +477,7 @@ jobs:
python_version: ${{ matrix.python-version }}
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: external
pytest_additional_args: -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }}
pytest_additional_args: ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }}
additional_pip_packages: |
pyzx==0.8.0 matplotlib stim quimb mitiq ply optax scipy-openblas32>=0.3.26
git+https://github.com/PennyLaneAI/pennylane-qiskit.git@master
Expand All @@ -480,9 +494,9 @@ jobs:
- setup-ci-load
- determine_runner
- default-dependency-versions
- disable-fail-fast-wae
- warnings-as-errors-setup
strategy:
fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }}
fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }}
max-parallel: >-
${{
fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).qcut-tests
Expand All @@ -504,7 +518,7 @@ jobs:
python_version: ${{ matrix.python-version }}
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: qcut
pytest_additional_args: -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }}
pytest_additional_args: ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }}
additional_pip_packages: |
kahypar==1.1.7
opt_einsum
Expand All @@ -520,9 +534,9 @@ jobs:
- setup-ci-load
- determine_runner
- default-dependency-versions
- disable-fail-fast-wae
- warnings-as-errors-setup
strategy:
fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }}
fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }}
max-parallel: >-
${{
fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).qchem-tests
Expand All @@ -545,7 +559,7 @@ jobs:
additional_pip_packages_post: ${{ needs.default-dependency-versions.outputs.pennylane-lightning-latest }}
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: qchem
pytest_additional_args: -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }}
pytest_additional_args: ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }}
additional_pip_packages: |
openfermionpyscf basis-set-exchange geometric scikit-learn
${{ inputs.additional_python_packages }}
Expand All @@ -555,9 +569,9 @@ jobs:
- setup-ci-load
- determine_runner
- default-dependency-versions
- disable-fail-fast-wae
- warnings-as-errors-setup
strategy:
fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }}
fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }}
max-parallel: >-
${{
fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).gradients-tests
Expand All @@ -580,7 +594,7 @@ jobs:
branch: ${{ inputs.branch }}
coverage_artifact_name: gradients-${{ matrix.config.suite }}-coverage
python_version: ${{ matrix.python-version }}
pytest_additional_args: -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }}
pytest_additional_args: ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }}
additional_pip_packages: |
${{ needs.default-dependency-versions.outputs.jax-version }}
${{ needs.default-dependency-versions.outputs.tensorflow-version }}
Expand All @@ -596,9 +610,9 @@ jobs:
- setup-ci-load
- determine_runner
- default-dependency-versions
- disable-fail-fast-wae
- warnings-as-errors-setup
strategy:
fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }}
fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }}
max-parallel: >-
${{
fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).data-tests
Expand All @@ -620,7 +634,7 @@ jobs:
python_version: ${{ matrix.python-version }}
additional_pip_packages_post: ${{ needs.default-dependency-versions.outputs.pennylane-lightning-latest }}
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_additional_args: -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }}
pytest_additional_args: ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }}
pytest_markers: data
additional_pip_packages: |
h5py
Expand All @@ -632,9 +646,9 @@ jobs:
- setup-ci-load
- determine_runner
- default-dependency-versions
- disable-fail-fast-wae
- warnings-as-errors-setup
strategy:
fail-fast: ${{ needs.disable-fail-fast-wae.outputs.fail_fast == 'default' }}
fail-fast: ${{ needs.warnings-as-errors-setup.outputs.fail_fast == 'default' }}
max-parallel: >-
${{
fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).device-tests
Expand Down Expand Up @@ -669,7 +683,7 @@ jobs:
additional_pip_packages_post: ${{ needs.default-dependency-versions.outputs.pennylane-lightning-latest }}
pytest_test_directory: pennylane/devices/tests
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_additional_args: --device=${{ matrix.config.device }} --shots=${{ matrix.config.shots }} -W ${{ inputs.python_warning_level }} ${{ inputs.python_warning_level != 'default' && '--continue-on-collection-errors' || '' }}
pytest_additional_args: --device=${{ matrix.config.device }} --shots=${{ matrix.config.shots }} ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }}


upload-to-codecov:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/module-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ jobs:
python-version: "3.10"

- name: Install dependencies
run: pip install tach==0.13.1
run: pip install tach==0.24.0

- name: Run tach
run: |
tach report pennylane/labs
tach report pennylane/ftqc
tach check
10 changes: 4 additions & 6 deletions .github/workflows/tests-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ env:
jobs:
gpu-tests:
runs-on:
- self-hosted
- ubuntu-22.04
- gpu

- single-gpu-x64

if: >-
${{
github.event_name == 'push' ||
Expand Down Expand Up @@ -57,13 +55,13 @@ jobs:
echo "LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" >> $GITHUB_ENV
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Setup Python
id: setup_python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ repos:
]
files: ^(pennylane/|tests/)
- repo: https://github.com/gauge-sh/tach-pre-commit
rev: v0.13.1
rev: v0.24.0
hooks:
- id: tach
- repo: local
Expand Down
2 changes: 1 addition & 1 deletion doc/code/qml_pauli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Dynamical Lie Algebras
----------------------

PennyLane provides support for working with dynamical Lie algebras (DLA) of Pauli operators.
See our `introduction to Dynamical Lie Algebras for quantum practitioners <https://pennylane.ai/qml/demos/tutorial_liealgebra/>`__.
See our :doc:`Introduction to Dynamical Lie Algebras for quantum practitioners <demos/tutorial_liealgebra>`.

.. currentmodule:: pennylane

Expand Down
5 changes: 0 additions & 5 deletions doc/code/qml_shadows.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
qml.shadows
=============

Overview
--------

.. currentmodule:: pennylane.shadows

.. automodule:: pennylane.shadows
10 changes: 10 additions & 0 deletions doc/development/deprecations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ deprecations are listed below.
Pending deprecations
--------------------

* The ``ControlledQubitUnitary`` will stop accepting `QubitUnitary` objects as arguments as its ``base``. Instead, use ``qml.ctrl`` to construct a controlled `QubitUnitary`.

- Deprecated in v0.41
- Will be removed in v0.42

* The ``control_wires`` argument in the ``qml.ControlledQubitUnitary`` class is deprecated. Instead, use the ``wires`` argument.

- Deprecated in v0.41
- Will be removed in v0.42

* The property ```MeasurementProcess.return_type``` has been deprecated.
If observable type checking is needed, please use direct ```isinstance```; if other text information is needed, please use class name, or another internal temporary private member ``_shortname``.

Expand Down
Loading

0 comments on commit 3d02fd5

Please sign in to comment.