-
Notifications
You must be signed in to change notification settings - Fork 603
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into emery_haldane_models
- Loading branch information
Showing
147 changed files
with
1,989 additions
and
2,991 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: NumPy 1 - Tests | ||
on: | ||
|
||
schedule: | ||
# Runs daily at 6 AM UTC (1 AM Toronto in winter, 2 AM in summer) | ||
- cron: '0 6 * * *' | ||
|
||
# Allows to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: numpy-1-unit-tests-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
tests: | ||
uses: ./.github/workflows/numpy_1_unit-tests.yml | ||
with: | ||
branch: ${{ github.ref }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,230 @@ | ||
# TODO: remove this workflow once compatibility with NumPy 1 | ||
# will no longer be tested. | ||
|
||
name: NumPy 1 - Unit Tests - Interfaces | ||
on: | ||
workflow_call: | ||
inputs: | ||
branch: | ||
description: The PennyLane branch to checkout and run unit tests for | ||
required: true | ||
type: string | ||
pipeline_mode: | ||
description: The pipeline mode can be unit-tests, benchmarks, or reference-benchmarks | ||
required: false | ||
type: string | ||
default: 'unit-tests' | ||
disable_new_opmath: | ||
description: Whether to disable the new op_math or not when running the tests | ||
required: false | ||
type: string | ||
default: "False" | ||
|
||
jobs: | ||
setup-ci-load: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup Python Versions | ||
id: python_versions | ||
|
||
run: | | ||
cat >python_versions.json <<-EOF | ||
{ | ||
"default": ["3.10", "3.11", "3.12"], | ||
"torch-tests": ["3.10", "3.12"], | ||
"jax-tests": ["3.10", "3.12"], | ||
"external-libraries-tests": ["3.10"], | ||
"data-tests": ["3.10"] | ||
} | ||
EOF | ||
jq . python_versions.json | ||
echo "python_versions=$(jq -r tostring python_versions.json)" >> $GITHUB_OUTPUT | ||
- name: Set NumPy Version | ||
id: numpy_version | ||
run: echo "NUMPY_VERSION=1.26" >> $GITHUB_ENV | ||
|
||
- name: Setup Matrix Max Parallel | ||
id: max_parallel | ||
run: | | ||
cat >matrix_max_parallel.json <<-EOF | ||
{ | ||
"default": 1, | ||
"core-tests": 5, | ||
"jax-tests": 10, | ||
"torch-tests": 2 | ||
} | ||
EOF | ||
jq . matrix_max_parallel.json | ||
echo "matrix_max_parallel=$(jq -r tostring matrix_max_parallel.json)" >> $GITHUB_OUTPUT | ||
outputs: | ||
matrix-max-parallel: ${{ steps.max_parallel.outputs.matrix_max_parallel }} | ||
python-version: ${{ steps.python_versions.outputs.python_versions }} | ||
|
||
torch-tests: | ||
needs: | ||
- setup-ci-load | ||
strategy: | ||
max-parallel: >- | ||
${{ | ||
fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).torch-tests | ||
|| fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).default | ||
}} | ||
matrix: | ||
python-version: >- | ||
${{ | ||
fromJSON(needs.setup-ci-load.outputs.python-version).torch-tests | ||
|| fromJSON(needs.setup-ci-load.outputs.python-version).default | ||
}} | ||
uses: ./.github/workflows/unit-test.yml | ||
with: | ||
job_name: torch-tests (${{ matrix.python-version }}, numpy-1.26) | ||
branch: ${{ inputs.branch }} | ||
coverage_artifact_name: core-interfaces-coverage-torch-${{ matrix.python-version }}-numpy-1.26 | ||
python_version: ${{ matrix.python-version }} | ||
pipeline_mode: ${{ inputs.pipeline_mode }} | ||
install_numpy_1: true | ||
install_jax: false | ||
install_tensorflow: false | ||
install_pytorch: true | ||
install_pennylane_lightning_master: true | ||
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' || '' }} | ||
disable_new_opmath: ${{ inputs.disable_new_opmath }} | ||
|
||
|
||
autograd-tests: | ||
needs: | ||
- setup-ci-load | ||
strategy: | ||
max-parallel: >- | ||
${{ | ||
fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).autograd-tests | ||
|| fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).default | ||
}} | ||
matrix: | ||
python-version: >- | ||
${{ | ||
fromJSON(needs.setup-ci-load.outputs.python-version).autograd-tests | ||
|| fromJSON(needs.setup-ci-load.outputs.python-version).default | ||
}} | ||
uses: ./.github/workflows/unit-test.yml | ||
with: | ||
job_name: autograd-tests (${{ matrix.python-version }}, numpy-1.26) | ||
branch: ${{ inputs.branch }} | ||
coverage_artifact_name: core-interfaces-coverage-autograd-${{ matrix.python-version }}-numpy-1.26 | ||
python_version: ${{ matrix.python-version }} | ||
pipeline_mode: ${{ inputs.pipeline_mode }} | ||
install_numpy_1: true | ||
install_jax: false | ||
install_tensorflow: false | ||
install_pytorch: false | ||
install_pennylane_lightning_master: true | ||
pytest_markers: autograd and not qcut and not finite-diff and not param-shift | ||
disable_new_opmath: ${{ inputs.disable_new_opmath }} | ||
|
||
|
||
jax-tests: | ||
needs: | ||
- setup-ci-load | ||
strategy: | ||
max-parallel: >- | ||
${{ | ||
fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).jax-tests | ||
|| fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).default | ||
}} | ||
matrix: | ||
group: [1, 2, 3, 4, 5] | ||
python-version: >- | ||
${{ | ||
fromJSON(needs.setup-ci-load.outputs.python-version).jax-tests | ||
|| fromJSON(needs.setup-ci-load.outputs.python-version).default | ||
}} | ||
uses: ./.github/workflows/unit-test.yml | ||
with: | ||
job_name: jax-tests (${{ matrix.group }}, ${{ matrix.python-version }}, numpy-1.26) | ||
branch: ${{ inputs.branch }} | ||
coverage_artifact_name: core-interfaces-coverage-jax-${{ matrix.python-version }}-${{ matrix.group }}-numpy-1.26 | ||
python_version: ${{ matrix.python-version }} | ||
pipeline_mode: ${{ inputs.pipeline_mode }} | ||
install_numpy_1: true | ||
install_jax: true | ||
install_tensorflow: false | ||
install_pytorch: false | ||
install_pennylane_lightning_master: true | ||
pytest_markers: jax and not qcut and not finite-diff and not param-shift | ||
pytest_additional_args: --dist=loadscope --splits 5 --group ${{ matrix.group }} | ||
additional_pip_packages: pytest-split | ||
requirements_file: ${{ github.event_name == 'schedule' && strategy.job-index == 0 && 'jax.txt' || '' }} | ||
disable_new_opmath: ${{ inputs.disable_new_opmath }} | ||
|
||
|
||
core-tests: | ||
needs: | ||
- setup-ci-load | ||
strategy: | ||
max-parallel: >- | ||
${{ | ||
fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).core-tests | ||
|| fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).default | ||
}} | ||
matrix: | ||
group: [1, 2, 3, 4, 5] | ||
python-version: >- | ||
${{ | ||
fromJSON(needs.setup-ci-load.outputs.python-version).core-tests | ||
|| fromJSON(needs.setup-ci-load.outputs.python-version).default | ||
}} | ||
uses: ./.github/workflows/unit-test.yml | ||
with: | ||
job_name: core-tests (${{ matrix.group }}, ${{ matrix.python-version }}, numpy-1.26) | ||
branch: ${{ inputs.branch }} | ||
coverage_artifact_name: core-interfaces-coverage-core-${{ matrix.python-version }}-${{ matrix.group }}-numpy-1.26 | ||
python_version: ${{ matrix.python-version }} | ||
pipeline_mode: ${{ inputs.pipeline_mode }} | ||
install_numpy_1: true | ||
install_jax: false | ||
install_tensorflow: false | ||
install_pytorch: false | ||
install_pennylane_lightning_master: true | ||
pytest_markers: core and not qcut and not finite-diff and not param-shift | ||
pytest_additional_args: --splits 5 --group ${{ matrix.group }} | ||
additional_pip_packages: pytest-split | ||
requirements_file: ${{ github.event_name == 'schedule' && strategy.job-index == 0 && 'core.txt' || '' }} | ||
disable_new_opmath: ${{ inputs.disable_new_opmath }} | ||
|
||
|
||
data-tests: | ||
needs: | ||
- setup-ci-load | ||
strategy: | ||
max-parallel: >- | ||
${{ | ||
fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).data-tests | ||
|| fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).default | ||
}} | ||
matrix: | ||
python-version: >- | ||
${{ | ||
fromJSON(needs.setup-ci-load.outputs.python-version).data-tests | ||
|| fromJSON(needs.setup-ci-load.outputs.python-version).default | ||
}} | ||
uses: ./.github/workflows/unit-test.yml | ||
with: | ||
job_name: data-tests (${{ matrix.python-version }}, numpy-1.26) | ||
branch: ${{ inputs.branch }} | ||
coverage_artifact_name: data-coverage-${{ matrix.python-version }}-numpy-1.26 | ||
python_version: ${{ matrix.python-version }} | ||
pipeline_mode: ${{ inputs.pipeline_mode }} | ||
install_numpy_1: true | ||
install_jax: false | ||
install_tensorflow: false | ||
install_pytorch: false | ||
install_pennylane_lightning_master: true | ||
pytest_markers: data | ||
additional_pip_packages: h5py | ||
disable_new_opmath: ${{ inputs.disable_new_opmath }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.