Skip to content

Commit

Permalink
Merge branch 'master' into kitaev_model
Browse files Browse the repository at this point in the history
  • Loading branch information
ddhawan11 authored Sep 17, 2024
2 parents c4db4eb + b78565c commit 8cf6bbb
Show file tree
Hide file tree
Showing 167 changed files with 3,350 additions and 25,741 deletions.
1 change: 0 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ on:
- reopened
- synchronize
- ready_for_review
- labeled

jobs:
sphinx:
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- reopened
- synchronize
- ready_for_review
- labeled

jobs:
black-pylint:
Expand All @@ -22,7 +21,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: "3.10"

- name: Install dependencies
run: pip install black pylint==2.7.4 isort==5.13.2
Expand All @@ -31,13 +30,13 @@ jobs:

- name: Run Black
run: |
black -t py39 -t py310 -t py311 -l 100 pennylane/ --check
black -t py39 -t py310 -t py311 -l 100 tests/ --check
black -t py310 -t py311 -t py312 -l 100 pennylane/ --check
black -t py310 -t py311 -t py312 -l 100 tests/ --check
- name: Run isort
run: |
isort --py 311 --profile black -l 100 -o autoray -p ./pennylane --skip __init__.py --filter-files ./pennylane --check
isort --py 311 --profile black -l 100 -o autoray -p ./pennylane --skip __init__.py --filter-files ./tests --check
isort --py 312 --profile black -l 100 -o autoray -p ./pennylane --skip __init__.py --filter-files ./pennylane --check
isort --py 312 --profile black -l 100 -o autoray -p ./pennylane --skip __init__.py --filter-files ./tests --check
- name: Run Pylint (source files)
if: always()
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/install_deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@ inputs:
python_version:
description: The version of Python to use in order to run unit tests
required: false
default: '3.9'
default: '3.10'
install_jax:
description: Indicate if JAX should be installed or not
required: false
default: 'true'
jax_version:
description: The version of JAX to install for any job that requires JAX
required: false
default: 0.4.23
default: '0.4.23'
install_tensorflow:
description: Indicate if TensorFlow should be installed or not
required: false
default: 'true'
tensorflow_version:
description: The version of TensorFlow to install for any job that requires TensorFlow
required: false
default: 2.16.0
default: '2.16.0'
install_pytorch:
description: Indicate if PyTorch should be installed or not
required: false
default: 'true'
pytorch_version:
description: The version of PyTorch to install for any job that requires PyTorch
required: false
default: 2.3.0
default: '2.3.0'
install_pennylane_lightning_master:
description: Indicate if PennyLane-Lightning should be installed from the master branch
required: false
Expand Down
31 changes: 15 additions & 16 deletions .github/workflows/interface-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:
Indicate if a lightened version of the CI should be run instead of the entire suite.
The lightened version of the CI includes the following changes:
- Only Python 3.9 is tested against, instead of 3.9, 3.10, 3.11, 3.12
- Only Python 3.10 is tested against, instead of 3.10, 3.11, 3.12
required: false
type: boolean
default: false
Expand Down Expand Up @@ -63,23 +63,23 @@ jobs:
then
cat >python_versions.json <<-EOF
{
"default": ["3.9"]
"default": ["3.10"]
}
EOF
else
cat >python_versions.json <<-EOF
{
"default": ["3.9", "3.10", "3.11", "3.12"],
"torch-tests": ["3.9", "3.11"],
"tf-tests": ["3.9", "3.11"],
"jax-tests": ["3.9", "3.12"],
"all-interfaces-tests": ["3.9"],
"external-libraries-tests": ["3.9"],
"qcut-tests": ["3.9"],
"qchem-tests": ["3.9"],
"gradients-tests": ["3.9"],
"data-tests": ["3.9", "3.10"],
"device-tests": ["3.9"]
"default": ["3.10", "3.11", "3.12"],
"torch-tests": ["3.10", "3.12"],
"tf-tests": ["3.10", "3.12"],
"jax-tests": ["3.10", "3.12"],
"all-interfaces-tests": ["3.10"],
"external-libraries-tests": ["3.10"],
"qcut-tests": ["3.10"],
"qchem-tests": ["3.10"],
"gradients-tests": ["3.10"],
"data-tests": ["3.10"],
"device-tests": ["3.10"]
}
EOF
fi
Expand Down Expand Up @@ -379,8 +379,7 @@ jobs:
# catalyst requires the latest version of pennylane that is about to be released.
# Installing catalyst after pennylane to make sure that the latest catalyst is used.
install_catalyst_nightly: true
# using lightning master does not work for the tests with external libraries
install_pennylane_lightning_master: false
install_pennylane_lightning_master: true
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: external
additional_pip_packages: pyzx matplotlib stim quimb mitiq pennylane-qiskit ply
Expand Down Expand Up @@ -508,7 +507,7 @@ jobs:
with:
job_name: data-tests (${{ matrix.python-version }})
branch: ${{ inputs.branch }}
coverage_artifact_name: data-coverage
coverage_artifact_name: data-coverage-${{ matrix.python-version }}
python_version: ${{ matrix.python-version }}
pipeline_mode: ${{ inputs.pipeline_mode }}
install_jax: false
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/tests-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ on:
- reopened
- synchronize
- ready_for_review
- labeled

concurrency:
group: gpu-test-${{ github.ref }}
cancel-in-progress: true

env:
TORCH_VERSION: 2.2.0
TORCH_VERSION: 2.3.0

jobs:
gpu-tests:
Expand All @@ -40,9 +39,9 @@ jobs:
max-parallel: 2
matrix:
python-version:
- 3.9
- '3.10'
- '3.11'
- '3.12'

env:
SUITE: gpu
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
- reopened
- synchronize
- ready_for_review
- labeled
# Scheduled trigger on Monday at 2:47am UTC
schedule:
- cron: '47 2 * * 1'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
description: The version of Python to use in order to run unit tests
required: false
type: string
default: '3.9'
default: '3.10'
pipeline_mode:
description: The pipeline mode can be unit-tests, benchmarks, or reference-benchmark
required: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: "3.10"

- name: Build PennyLane wheel
run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ config.toml
qml_debug.log
datasets/*
.benchmarks/*
*.h5
*.hdf5
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.9"
python: "3.10"
apt_packages:
- graphviz

Expand Down
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,10 @@ clean-docs:

test:
$(PYTHON) $(TESTRUNNER)
$(PYTHON) $(PLUGIN_TESTRUNNER) --device=default.qubit.autograd

coverage:
@echo "Generating coverage report..."
$(PYTHON) $(TESTRUNNER) $(COVERAGE)
$(PYTHON) $(PLUGIN_TESTRUNNER) --device=default.qubit.autograd $(COVERAGE) --cov-append

.PHONY:format
format:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@

## Installation

PennyLane requires Python version 3.9 and above. Installation of PennyLane, as well as all
PennyLane requires Python version 3.10 and above. Installation of PennyLane, as well as all
dependencies, can be done using pip:

```console
Expand Down
34 changes: 26 additions & 8 deletions doc/development/deprecations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ deprecations are listed below.
Pending deprecations
--------------------

* All of the legacy devices (any with the name ``default.qubit.{autograd,torch,tf,jax,legacy}``) are deprecated. Use ``default.qubit`` instead,
as it supports backpropagation for the many backends the legacy devices support.
* ``Device``, ``QubitDevice``, and ``QutritDevice`` will no longer be imported top level in v0.40. They instead
we be available as ``qml.devices.LegacyDevice``, ``qml.devices.QubitDevice``, and ``qml.devices.QutritDevice``
respectively.

- Deprecated in v0.38
- Will be removed in v0.39
- Deprecated top level access in v0.39
- Top level access removed in v0.40

* The logic for internally switching a device for a different backpropagation
compatible device is now deprecated, as it was in place for the deprecated ``default.qubit.legacy``.
* `QNode.gradient_fn` is deprecated. Please use `QNode.diff_method` instead. `QNode.get_gradient_fn` can also be used to
process the diff method.

- Deprecated in v0.38
- Will be removed in v0.39
- Deprecated in v0.39
- Will be removed in v0.40

* The ``decomp_depth`` argument in ``qml.device`` is deprecated.

Expand Down Expand Up @@ -82,6 +83,23 @@ Other deprecations
Completed deprecation cycles
----------------------------

* All of the legacy devices (any with the name ``default.qubit.{autograd,torch,tf,jax,legacy}``) are removed. Use ``default.qubit`` instead,
as it supports backpropagation for the many backends the legacy devices support.

- Deprecated in v0.38
- Removed in v0.39

* The logic for internally switching a device for a different backpropagation
compatible device is removed, as it was in place for removed ``default.qubit.legacy``.

- Deprecated in v0.38
- Removed in v0.39

* `Operator.expand` is now removed. Use `qml.tape.QuantumScript(op.deocomposition())` instead.

- Deprecated in v0.38
- Removed in v0.39

* The ``expansion_strategy`` attribute of ``qml.QNode`` is removed.
Users should make use of ``qml.workflow.construct_batch``, should they require fine control over the output tape(s).

Expand Down
2 changes: 1 addition & 1 deletion doc/development/guide/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ process, and surrounding operations:
# Get logger for use by this script only.
logger = logging.getLogger(__name__)
dev_name = "default.qubit.jax"
dev_name = "default.qubit"
num_wires = 2
num_shots = None
Expand Down
2 changes: 2 additions & 0 deletions doc/development/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ This page contains the release notes for PennyLane.

.. mdinclude:: ../releases/changelog-dev.md

.. mdinclude:: ../releases/changelog-0.38.1.md

.. mdinclude:: ../releases/changelog-0.38.0.md

.. mdinclude:: ../releases/changelog-0.37.0.md
Expand Down
8 changes: 4 additions & 4 deletions doc/introduction/interfaces/jax.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ a JAX-capable QNode in PennyLane. Simply specify the ``interface='jax'`` keyword

.. code-block:: python
dev = qml.device('default.qubit.jax', wires=2)
dev = qml.device('default.qubit', wires=2)
@qml.qnode(dev, interface='jax')
def circuit1(phi, theta):
Expand Down Expand Up @@ -85,7 +85,7 @@ For example:

.. code-block:: python
dev = qml.device('default.qubit.jax', wires=2)
dev = qml.device('default.qubit', wires=2)
@qml.qnode(dev, interface='jax')
def circuit3(phi, theta):
Expand Down Expand Up @@ -119,7 +119,7 @@ the ``@jax.jit`` decorator can be directly applied to the QNode.

.. code-block:: python
dev = qml.device('default.qubit.jax', wires=2)
dev = qml.device('default.qubit', wires=2)
@jax.jit # QNode calls will now be jitted, and should run faster.
@qml.qnode(dev, interface='jax')
Expand Down Expand Up @@ -176,7 +176,7 @@ Example:
# Device construction should happen inside a `jax.jit` decorated
# method when using a PRNGKey.
dev = qml.device('default.qubit.jax', wires=2, prng_key=key, shots=100)
dev = qml.device('default.qubit', wires=2, prng_key=key, shots=100)
@qml.qnode(dev, interface='jax', diff_method=None)
Expand Down
2 changes: 1 addition & 1 deletion doc/releases/changelog-0.38.0.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:orphan:

# Release 0.38.0 (current release)
# Release 0.38.0

<h3>New features since last release</h3>

Expand Down
14 changes: 14 additions & 0 deletions doc/releases/changelog-0.38.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
:orphan:

# Release 0.38.1 (current release)

<h3>Bug fixes 🐛</h3>

* Fix float-to-complex casting in various places across PennyLane.
[(#6260)](https://github.com/PennyLaneAI/pennylane/pull/6260)

<h3>Contributors ✍️</h3>

This release contains contributions from (in alphabetical order):

Mudit Pandey
Loading

0 comments on commit 8cf6bbb

Please sign in to comment.