├── .gitattributes ├── .github └── workflows │ ├── .DS_Store │ ├── aqt-latest-latest.yml │ ├── aqt-latest-rc.yml │ ├── aqt-latest-stable.yml │ ├── aqt-stable-latest.yml │ ├── aqt-stable-stable.yml │ ├── braket-latest-latest.yml │ ├── braket-latest-rc.yml │ ├── braket-latest-stable.yml │ ├── braket-stable-latest.yml │ ├── braket-stable-stable.yml │ ├── cirq-latest-latest.yml │ ├── cirq-latest-rc.yml │ ├── cirq-latest-stable.yml │ ├── cirq-stable-latest.yml │ ├── cirq-stable-stable.yml │ ├── ensure_compiled.yml │ ├── ionq-latest-latest.yml │ ├── ionq-latest-rc.yml │ ├── ionq-latest-stable.yml │ ├── ionq-stable-latest.yml │ ├── ionq-stable-stable.yml │ ├── lightning-latest-rc.yml │ ├── old-workflow │ ├── qiskit-latest-latest.yml │ ├── qiskit-latest-rc.yml │ ├── qiskit-latest-stable.yml │ ├── qiskit-stable-latest.yml │ ├── qiskit-stable-stable.yml │ ├── qulacs-latest-latest.yml │ ├── qulacs-latest-rc.yml │ ├── qulacs-latest-stable.yml │ ├── qulacs-stable-latest.yml │ ├── qulacs-stable-stable.yml │ ├── scripts │ └── unique_warning_reporter.sh │ └── workflow-wae-reporting.yml ├── README.md ├── compile.py ├── workflow-template-latest.yml ├── workflow-template-release-candidate.yml └── workflow-template-stable.yml /.gitattributes: -------------------------------------------------------------------------------- 1 | .github/workflows/*.yml linguist-generated=true 2 | -------------------------------------------------------------------------------- /.github/workflows/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PennyLaneAI/plugin-test-matrix/9fb1250baccd805ddafc4b39fe14052a8617aa0f/.github/workflows/.DS_Store -------------------------------------------------------------------------------- /.github/workflows/aqt-latest-latest.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane latest 2 | 3 | name: aqt-latest-latest 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-aqt 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_aqt 18 | PENNYLANE_BRANCH: master 19 | 20 | 21 | jobs: 22 | tests: 23 | runs-on: ubuntu-latest 24 | 25 | strategy: 26 | fail-fast: false 27 | 28 | steps: 29 | - name: Cancel Previous Runs 30 | uses: styfle/cancel-workflow-action@0.4.1 31 | with: 32 | access_token: ${{ github.token }} 33 | 34 | - name: Set up Python 35 | uses: actions/setup-python@v2 36 | with: 37 | python-version: "3.10" 38 | 39 | - name: Install requirements 40 | run: | 41 | pip install --upgrade pip 42 | pip install 'pytest<8.1.0' 43 | pip install pytest-mock pytest-cov flaky pytest-benchmark 44 | pip freeze 45 | 46 | - name: Install PennyLane and Plugin 47 | run: | 48 | pip install git+https://github.com/PennyLaneAI/pennylane.git \ 49 | git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }} 50 | 51 | - uses: actions/checkout@v2 52 | with: 53 | repository: ${{ env.PLUGIN_REPO }} 54 | path: plugin_repo 55 | ref: ${{ env.PLUGIN_BRANCH }} 56 | 57 | - name: Run PennyLane device integration tests 58 | run: | 59 | 60 | - name: Run plugin tests 61 | run: | 62 | python -m pytest plugin_repo/tests --tb=short \ 63 | -W "error::pennylane.PennyLaneDeprecationWarning" 64 | -------------------------------------------------------------------------------- /.github/workflows/aqt-latest-rc.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane release candidate 2 | 3 | name: aqt-latest-rc 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-aqt 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_aqt 18 | PENNYLANE_BRANCH: master 19 | 20 | 21 | jobs: 22 | tests: 23 | runs-on: ubuntu-latest 24 | 25 | strategy: 26 | fail-fast: false 27 | 28 | steps: 29 | - name: Cancel Previous Runs 30 | uses: styfle/cancel-workflow-action@0.4.1 31 | with: 32 | access_token: ${{ github.token }} 33 | 34 | - name: Set up Python 35 | uses: actions/setup-python@v2 36 | with: 37 | python-version: "3.10" 38 | 39 | - name: Install requirements 40 | run: | 41 | pip install --upgrade pip 42 | pip install 'pytest<8.1.0' 43 | pip install pytest-mock pytest-cov flaky pytest-benchmark 44 | pip freeze 45 | 46 | - name: Install PennyLane and Plugin 47 | run: | 48 | pip install git+https://github.com/PennyLaneAI/pennylane.git@v0.41.0-rc0 \ 49 | git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }} 50 | 51 | - uses: actions/checkout@v2 52 | with: 53 | repository: ${{ env.PLUGIN_REPO }} 54 | path: plugin_repo 55 | ref: ${{ env.PLUGIN_BRANCH }} 56 | 57 | - name: Run PennyLane device integration tests 58 | run: | 59 | 60 | - name: Run plugin tests 61 | run: python -m pytest plugin_repo/tests --tb=short 62 | -------------------------------------------------------------------------------- /.github/workflows/aqt-latest-stable.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane stable 2 | 3 | name: aqt-latest-stable 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * 0' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-aqt 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_aqt 18 | PENNYLANE_BRANCH: master 19 | 20 | 21 | jobs: 22 | tests: 23 | runs-on: ubuntu-latest 24 | 25 | strategy: 26 | fail-fast: false 27 | 28 | steps: 29 | - name: Cancel Previous Runs 30 | uses: styfle/cancel-workflow-action@0.4.1 31 | with: 32 | access_token: ${{ github.token }} 33 | 34 | - name: Set up Python 35 | uses: actions/setup-python@v2 36 | with: 37 | python-version: "3.10" 38 | 39 | - name: Install requirements 40 | run: | 41 | pip install --upgrade pip 42 | pip install 'pytest<8.1.0' 43 | pip install pytest-mock pytest-cov flaky pytest-benchmark 44 | pip freeze 45 | 46 | - name: Install PennyLane and Plugin 47 | run: | 48 | pip install pennylane git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }} 49 | 50 | - uses: actions/checkout@v2 51 | with: 52 | repository: ${{ env.PLUGIN_REPO }} 53 | path: plugin_repo 54 | ref: ${{ env.PLUGIN_BRANCH }} 55 | 56 | 57 | - name: Run plugin tests 58 | run: python -m pytest plugin_repo/tests --tb=short 59 | -------------------------------------------------------------------------------- /.github/workflows/aqt-stable-latest.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane latest 2 | 3 | name: aqt-stable-latest 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-aqt 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_aqt 18 | PENNYLANE_BRANCH: master 19 | 20 | 21 | jobs: 22 | tests: 23 | runs-on: ubuntu-latest 24 | 25 | strategy: 26 | fail-fast: false 27 | 28 | steps: 29 | - name: Cancel Previous Runs 30 | uses: styfle/cancel-workflow-action@0.4.1 31 | with: 32 | access_token: ${{ github.token }} 33 | 34 | - name: Set up Python 35 | uses: actions/setup-python@v2 36 | with: 37 | python-version: "3.10" 38 | 39 | - name: Install requirements 40 | run: | 41 | pip install --upgrade pip 42 | pip install 'pytest<8.1.0' 43 | pip install pytest-mock pytest-cov flaky pytest-benchmark 44 | pip freeze 45 | 46 | - name: Install PennyLane and Plugin 47 | run: | 48 | pip install git+https://github.com/PennyLaneAI/pennylane.git \ 49 | ${{ env.PLUGIN_PACKAGE }} --upgrade 50 | 51 | - name: Get plugin version 52 | id: plugin-version 53 | run: | 54 | PLUGIN_VERSION=$(python -c "import pkg_resources as pkg; print(pkg.get_distribution('${{ env.PLUGIN_PACKAGE }}').version)") 55 | echo "version=$PLUGIN_VERSION" >> $GITHUB_OUTPUT 56 | 57 | - uses: actions/checkout@v2 58 | with: 59 | repository: ${{ env.PLUGIN_REPO }} 60 | path: plugin_repo 61 | ref: v${{ steps.plugin-version.outputs.version }} 62 | 63 | - name: Run PennyLane device integration tests 64 | run: | 65 | 66 | - name: Run plugin tests 67 | run: | 68 | python -m pytest plugin_repo/tests --tb=short \ 69 | -W "error::pennylane.PennyLaneDeprecationWarning" 70 | -------------------------------------------------------------------------------- /.github/workflows/aqt-stable-stable.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane stable 2 | 3 | name: aqt-stable-stable 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * 0' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-aqt 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_aqt 18 | PENNYLANE_BRANCH: master 19 | 20 | 21 | jobs: 22 | tests: 23 | runs-on: ubuntu-latest 24 | 25 | strategy: 26 | fail-fast: false 27 | 28 | steps: 29 | - name: Cancel Previous Runs 30 | uses: styfle/cancel-workflow-action@0.4.1 31 | with: 32 | access_token: ${{ github.token }} 33 | 34 | - name: Set up Python 35 | uses: actions/setup-python@v2 36 | with: 37 | python-version: "3.10" 38 | 39 | - name: Install requirements 40 | run: | 41 | pip install --upgrade pip 42 | pip install 'pytest<8.1.0' 43 | pip install pytest-mock pytest-cov flaky pytest-benchmark 44 | pip freeze 45 | 46 | - name: Install PennyLane and Plugin 47 | run: | 48 | pip install pennylane ${{ env.PLUGIN_PACKAGE }} --upgrade 49 | pip freeze 50 | 51 | - name: Get plugin version 52 | id: plugin-version 53 | run: | 54 | PLUGIN_VERSION=$(python -c "import pkg_resources as pkg; print(pkg.get_distribution('${{ env.PLUGIN_PACKAGE }}').version)") 55 | echo "version=$PLUGIN_VERSION" >> $GITHUB_OUTPUT 56 | 57 | - uses: actions/checkout@v2 58 | with: 59 | repository: ${{ env.PLUGIN_REPO }} 60 | path: plugin_repo 61 | ref: v${{ steps.plugin-version.outputs.version }} 62 | 63 | 64 | - name: Run plugin tests 65 | run: python -m pytest plugin_repo/tests --tb=short 66 | -------------------------------------------------------------------------------- /.github/workflows/braket-latest-latest.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane latest 2 | 3 | name: braket-latest-latest 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: aws/amazon-braket-pennylane-plugin-python 16 | PLUGIN_BRANCH: main 17 | PLUGIN_PACKAGE: amazon-braket-pennylane-plugin 18 | PENNYLANE_BRANCH: master 19 | TF_VERSION: 2.12.0 20 | TORCH_VERSION: 2.0.0+cpu 21 | JAX_VERSION: 0.4.28 22 | 23 | 24 | jobs: 25 | tests: 26 | runs-on: ubuntu-latest 27 | 28 | strategy: 29 | fail-fast: false 30 | 31 | steps: 32 | - name: Cancel Previous Runs 33 | uses: styfle/cancel-workflow-action@0.4.1 34 | with: 35 | access_token: ${{ github.token }} 36 | 37 | - name: Set up Python 38 | uses: actions/setup-python@v2 39 | with: 40 | python-version: "3.10" 41 | 42 | - name: Install TF 43 | run: | 44 | pip install tensorflow~=$TF_VERSION keras~=$TF_VERSION 45 | 46 | - name: Install JAX 47 | run: | 48 | pip install jax==$JAX_VERSION jaxlib==$JAX_VERSION 49 | 50 | - name: Install requirements 51 | run: | 52 | pip install --upgrade pip 53 | pip install --upgrade pytest-xdist 54 | pip install 'pytest<8.1.0' 55 | pip install pytest-mock pytest-cov flaky pytest-benchmark 56 | pip freeze 57 | 58 | - name: Install PennyLane and Plugin 59 | run: | 60 | pip install git+https://github.com/PennyLaneAI/pennylane.git \ 61 | git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }} 62 | 63 | - uses: actions/checkout@v2 64 | with: 65 | repository: ${{ env.PLUGIN_REPO }} 66 | path: plugin_repo 67 | ref: ${{ env.PLUGIN_BRANCH }} 68 | 69 | - name: Run PennyLane device integration tests 70 | run: | 71 | pl-device-test --device=braket.local.qubit --tb=short --skip-ops --shots=20000 -k 'not no_0_shots' 72 | pl-device-test --device=braket.local.qubit --tb=short --skip-ops -k 'not Sample and not no_0_shots' 73 | 74 | - name: Run plugin tests 75 | run: | 76 | python -m pytest plugin_repo/test/unit_tests --tb=short 77 | -------------------------------------------------------------------------------- /.github/workflows/braket-latest-rc.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane release candidate 2 | 3 | name: braket-latest-rc 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: aws/amazon-braket-pennylane-plugin-python 16 | PLUGIN_BRANCH: main 17 | PLUGIN_PACKAGE: amazon-braket-pennylane-plugin 18 | PENNYLANE_BRANCH: master 19 | TF_VERSION: 2.12.0 20 | TORCH_VERSION: 2.0.0+cpu 21 | JAX_VERSION: 0.4.28 22 | 23 | 24 | jobs: 25 | tests: 26 | runs-on: ubuntu-latest 27 | 28 | strategy: 29 | fail-fast: false 30 | 31 | steps: 32 | - name: Cancel Previous Runs 33 | uses: styfle/cancel-workflow-action@0.4.1 34 | with: 35 | access_token: ${{ github.token }} 36 | 37 | - name: Set up Python 38 | uses: actions/setup-python@v2 39 | with: 40 | python-version: "3.10" 41 | 42 | - name: Install TF 43 | run: | 44 | pip install tensorflow~=$TF_VERSION keras~=$TF_VERSION 45 | 46 | - name: Install JAX 47 | run: | 48 | pip install jax==$JAX_VERSION jaxlib==$JAX_VERSION 49 | 50 | - name: Install requirements 51 | run: | 52 | pip install --upgrade pip 53 | pip install --upgrade pytest-xdist 54 | pip install 'pytest<8.1.0' 55 | pip install pytest-mock pytest-cov flaky pytest-benchmark 56 | pip freeze 57 | 58 | - name: Install PennyLane and Plugin 59 | run: | 60 | pip install git+https://github.com/PennyLaneAI/pennylane.git@v0.41.0-rc0 \ 61 | git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }} 62 | 63 | - uses: actions/checkout@v2 64 | with: 65 | repository: ${{ env.PLUGIN_REPO }} 66 | path: plugin_repo 67 | ref: ${{ env.PLUGIN_BRANCH }} 68 | 69 | - name: Run PennyLane device integration tests 70 | run: | 71 | pl-device-test --device=braket.local.qubit --tb=short --skip-ops --shots=20000 -k 'not no_0_shots' 72 | pl-device-test --device=braket.local.qubit --tb=short --skip-ops -k 'not Sample and not no_0_shots' 73 | 74 | - name: Run plugin tests 75 | run: python -m pytest plugin_repo/test/unit_tests --tb=short 76 | -------------------------------------------------------------------------------- /.github/workflows/braket-latest-stable.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane stable 2 | 3 | name: braket-latest-stable 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * 0' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: aws/amazon-braket-pennylane-plugin-python 16 | PLUGIN_BRANCH: main 17 | PLUGIN_PACKAGE: amazon-braket-pennylane-plugin 18 | PENNYLANE_BRANCH: master 19 | TF_VERSION: 2.12.0 20 | TORCH_VERSION: 2.0.0+cpu 21 | JAX_VERSION: 0.4.28 22 | 23 | 24 | jobs: 25 | tests: 26 | runs-on: ubuntu-latest 27 | 28 | strategy: 29 | fail-fast: false 30 | 31 | steps: 32 | - name: Cancel Previous Runs 33 | uses: styfle/cancel-workflow-action@0.4.1 34 | with: 35 | access_token: ${{ github.token }} 36 | 37 | - name: Set up Python 38 | uses: actions/setup-python@v2 39 | with: 40 | python-version: "3.10" 41 | 42 | - name: Install TF 43 | run: | 44 | pip install tensorflow~=$TF_VERSION keras~=$TF_VERSION 45 | 46 | - name: Install JAX 47 | run: | 48 | pip install jax==$JAX_VERSION jaxlib==$JAX_VERSION 49 | 50 | - name: Install requirements 51 | run: | 52 | pip install --upgrade pip 53 | pip install --upgrade pytest-xdist 54 | pip install 'pytest<8.1.0' 55 | pip install pytest-mock pytest-cov flaky pytest-benchmark 56 | pip freeze 57 | 58 | - name: Install PennyLane and Plugin 59 | run: | 60 | pip install pennylane git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }} 61 | 62 | - uses: actions/checkout@v2 63 | with: 64 | repository: ${{ env.PLUGIN_REPO }} 65 | path: plugin_repo 66 | ref: ${{ env.PLUGIN_BRANCH }} 67 | - name: Run PennyLane device integration tests 68 | run: | 69 | if ! [ -x "$(command -v pl-device-test)" ]; then 70 | echo 'Error: Version of PennyLane does not provide device integration tests.' >&2 71 | else 72 | pl-device-test --device=braket.local.qubit --tb=short --skip-ops --shots=20000 -k 'not no_0_shots' 73 | pl-device-test --device=braket.local.qubit --tb=short --skip-ops -k 'not Sample and not no_0_shots' 74 | fi 75 | 76 | - name: Run plugin tests 77 | run: python -m pytest plugin_repo/test/unit_tests --tb=short 78 | -------------------------------------------------------------------------------- /.github/workflows/braket-stable-latest.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane latest 2 | 3 | name: braket-stable-latest 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: aws/amazon-braket-pennylane-plugin-python 16 | PLUGIN_BRANCH: main 17 | PLUGIN_PACKAGE: amazon-braket-pennylane-plugin 18 | PENNYLANE_BRANCH: master 19 | TF_VERSION: 2.12.0 20 | TORCH_VERSION: 2.0.0+cpu 21 | JAX_VERSION: 0.4.28 22 | 23 | 24 | jobs: 25 | tests: 26 | runs-on: ubuntu-latest 27 | 28 | strategy: 29 | fail-fast: false 30 | 31 | steps: 32 | - name: Cancel Previous Runs 33 | uses: styfle/cancel-workflow-action@0.4.1 34 | with: 35 | access_token: ${{ github.token }} 36 | 37 | - name: Set up Python 38 | uses: actions/setup-python@v2 39 | with: 40 | python-version: "3.10" 41 | 42 | - name: Install TF 43 | run: | 44 | pip install tensorflow~=$TF_VERSION keras~=$TF_VERSION 45 | 46 | - name: Install JAX 47 | run: | 48 | pip install jax==$JAX_VERSION jaxlib==$JAX_VERSION 49 | 50 | - name: Install requirements 51 | run: | 52 | pip install --upgrade pip 53 | pip install --upgrade pytest-xdist 54 | pip install 'pytest<8.1.0' 55 | pip install pytest-mock pytest-cov flaky pytest-benchmark 56 | pip freeze 57 | 58 | - name: Install PennyLane and Plugin 59 | run: | 60 | pip install git+https://github.com/PennyLaneAI/pennylane.git \ 61 | ${{ env.PLUGIN_PACKAGE }} --upgrade 62 | 63 | - name: Get plugin version 64 | id: plugin-version 65 | run: | 66 | PLUGIN_VERSION=$(python -c "import pkg_resources as pkg; print(pkg.get_distribution('${{ env.PLUGIN_PACKAGE }}').version)") 67 | echo "version=$PLUGIN_VERSION" >> $GITHUB_OUTPUT 68 | 69 | - uses: actions/checkout@v2 70 | with: 71 | repository: ${{ env.PLUGIN_REPO }} 72 | path: plugin_repo 73 | ref: v${{ steps.plugin-version.outputs.version }} 74 | 75 | - name: Run PennyLane device integration tests 76 | run: | 77 | pl-device-test --device=braket.local.qubit --tb=short --skip-ops --shots=20000 -k 'not no_0_shots' 78 | pl-device-test --device=braket.local.qubit --tb=short --skip-ops -k 'not Sample and not no_0_shots' 79 | 80 | - name: Run plugin tests 81 | run: | 82 | python -m pytest plugin_repo/test/unit_tests --tb=short 83 | -------------------------------------------------------------------------------- /.github/workflows/braket-stable-stable.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane stable 2 | 3 | name: braket-stable-stable 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * 0' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: aws/amazon-braket-pennylane-plugin-python 16 | PLUGIN_BRANCH: main 17 | PLUGIN_PACKAGE: amazon-braket-pennylane-plugin 18 | PENNYLANE_BRANCH: master 19 | TF_VERSION: 2.12.0 20 | TORCH_VERSION: 2.0.0+cpu 21 | JAX_VERSION: 0.4.28 22 | 23 | 24 | jobs: 25 | tests: 26 | runs-on: ubuntu-latest 27 | 28 | strategy: 29 | fail-fast: false 30 | 31 | steps: 32 | - name: Cancel Previous Runs 33 | uses: styfle/cancel-workflow-action@0.4.1 34 | with: 35 | access_token: ${{ github.token }} 36 | 37 | - name: Set up Python 38 | uses: actions/setup-python@v2 39 | with: 40 | python-version: "3.10" 41 | 42 | - name: Install TF 43 | run: | 44 | pip install tensorflow~=$TF_VERSION keras~=$TF_VERSION 45 | 46 | - name: Install JAX 47 | run: | 48 | pip install jax==$JAX_VERSION jaxlib==$JAX_VERSION 49 | 50 | - name: Install requirements 51 | run: | 52 | pip install --upgrade pip 53 | pip install --upgrade pytest-xdist 54 | pip install 'pytest<8.1.0' 55 | pip install pytest-mock pytest-cov flaky pytest-benchmark 56 | pip freeze 57 | 58 | - name: Install PennyLane and Plugin 59 | run: | 60 | pip install pennylane ${{ env.PLUGIN_PACKAGE }} --upgrade 61 | pip freeze 62 | 63 | - name: Get plugin version 64 | id: plugin-version 65 | run: | 66 | PLUGIN_VERSION=$(python -c "import pkg_resources as pkg; print(pkg.get_distribution('${{ env.PLUGIN_PACKAGE }}').version)") 67 | echo "version=$PLUGIN_VERSION" >> $GITHUB_OUTPUT 68 | 69 | - uses: actions/checkout@v2 70 | with: 71 | repository: ${{ env.PLUGIN_REPO }} 72 | path: plugin_repo 73 | ref: v${{ steps.plugin-version.outputs.version }} 74 | - name: Run PennyLane device integration tests 75 | run: | 76 | if ! [ -x "$(command -v pl-device-test)" ]; then 77 | echo 'Error: Version of PennyLane does not provide device integration tests.' >&2 78 | else 79 | pl-device-test --device=braket.local.qubit --tb=short --skip-ops --shots=20000 -k 'not no_0_shots' 80 | pl-device-test --device=braket.local.qubit --tb=short --skip-ops -k 'not Sample and not no_0_shots' 81 | fi 82 | 83 | - name: Run plugin tests 84 | run: python -m pytest plugin_repo/test/unit_tests --tb=short 85 | -------------------------------------------------------------------------------- /.github/workflows/cirq-latest-latest.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane latest 2 | 3 | name: cirq-latest-latest 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-cirq 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_cirq 18 | PENNYLANE_BRANCH: master 19 | 20 | 21 | jobs: 22 | tests: 23 | runs-on: ubuntu-latest 24 | 25 | strategy: 26 | fail-fast: false 27 | 28 | steps: 29 | - name: Cancel Previous Runs 30 | uses: styfle/cancel-workflow-action@0.4.1 31 | with: 32 | access_token: ${{ github.token }} 33 | 34 | - name: Set up Python 35 | uses: actions/setup-python@v2 36 | with: 37 | python-version: "3.11" 38 | 39 | - name: Install requirements 40 | run: | 41 | pip install --upgrade pip 42 | pip install --upgrade cirq 43 | pip install --upgrade qsimcirq 44 | pip install 'pytest<8.1.0' 45 | pip install pytest-mock pytest-cov flaky pytest-benchmark 46 | pip freeze 47 | 48 | - name: Install PennyLane and Plugin 49 | run: | 50 | pip install git+https://github.com/PennyLaneAI/pennylane.git \ 51 | git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }} 52 | 53 | - uses: actions/checkout@v2 54 | with: 55 | repository: ${{ env.PLUGIN_REPO }} 56 | path: plugin_repo 57 | ref: ${{ env.PLUGIN_BRANCH }} 58 | 59 | - name: Run PennyLane device integration tests 60 | run: | 61 | pl-device-test --device=cirq.simulator --tb=short --skip-ops --shots=None 62 | pl-device-test --device=cirq.simulator --tb=short --skip-ops --shots=20000 63 | pl-device-test --device=cirq.mixedsimulator --tb=short --skip-ops --shots=None 64 | pl-device-test --device=cirq.mixedsimulator --tb=short --skip-ops --shots=20000 65 | pl-device-test --device=cirq.pasqal --tb=short --skip-ops --analytic=False --shots=20000 --device-kwargs control_radius=2. 66 | pl-device-test --device=cirq.qsim --tb=short --skip-ops --analytic=False --shots=20000 67 | 68 | - name: Run plugin tests 69 | run: | 70 | python -m pytest plugin_repo/tests --tb=short \ 71 | -W "error::pennylane.PennyLaneDeprecationWarning" 72 | -------------------------------------------------------------------------------- /.github/workflows/cirq-latest-rc.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane release candidate 2 | 3 | name: cirq-latest-rc 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-cirq 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_cirq 18 | PENNYLANE_BRANCH: master 19 | 20 | 21 | jobs: 22 | tests: 23 | runs-on: ubuntu-latest 24 | 25 | strategy: 26 | fail-fast: false 27 | 28 | steps: 29 | - name: Cancel Previous Runs 30 | uses: styfle/cancel-workflow-action@0.4.1 31 | with: 32 | access_token: ${{ github.token }} 33 | 34 | - name: Set up Python 35 | uses: actions/setup-python@v2 36 | with: 37 | python-version: "3.11" 38 | 39 | - name: Install requirements 40 | run: | 41 | pip install --upgrade pip 42 | pip install --upgrade cirq 43 | pip install --upgrade qsimcirq 44 | pip install 'pytest<8.1.0' 45 | pip install pytest-mock pytest-cov flaky pytest-benchmark 46 | pip freeze 47 | 48 | - name: Install PennyLane and Plugin 49 | run: | 50 | pip install git+https://github.com/PennyLaneAI/pennylane.git@v0.41.0-rc0 \ 51 | git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }} 52 | 53 | - uses: actions/checkout@v2 54 | with: 55 | repository: ${{ env.PLUGIN_REPO }} 56 | path: plugin_repo 57 | ref: ${{ env.PLUGIN_BRANCH }} 58 | 59 | - name: Run PennyLane device integration tests 60 | run: | 61 | pl-device-test --device=cirq.simulator --tb=short --skip-ops --shots=None 62 | pl-device-test --device=cirq.simulator --tb=short --skip-ops --shots=20000 63 | pl-device-test --device=cirq.mixedsimulator --tb=short --skip-ops --shots=None 64 | pl-device-test --device=cirq.mixedsimulator --tb=short --skip-ops --shots=20000 65 | pl-device-test --device=cirq.pasqal --tb=short --skip-ops --analytic=False --shots=20000 --device-kwargs control_radius=2. 66 | pl-device-test --device=cirq.qsim --tb=short --skip-ops --analytic=False --shots=20000 67 | 68 | - name: Run plugin tests 69 | run: python -m pytest plugin_repo/tests --tb=short 70 | -------------------------------------------------------------------------------- /.github/workflows/cirq-latest-stable.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane stable 2 | 3 | name: cirq-latest-stable 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * 0' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-cirq 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_cirq 18 | PENNYLANE_BRANCH: master 19 | 20 | 21 | jobs: 22 | tests: 23 | runs-on: ubuntu-latest 24 | 25 | strategy: 26 | fail-fast: false 27 | 28 | steps: 29 | - name: Cancel Previous Runs 30 | uses: styfle/cancel-workflow-action@0.4.1 31 | with: 32 | access_token: ${{ github.token }} 33 | 34 | - name: Set up Python 35 | uses: actions/setup-python@v2 36 | with: 37 | python-version: "3.11" 38 | 39 | - name: Install requirements 40 | run: | 41 | pip install --upgrade pip 42 | pip install --upgrade cirq 43 | pip install --upgrade qsimcirq 44 | pip install 'pytest<8.1.0' 45 | pip install pytest-mock pytest-cov flaky pytest-benchmark 46 | pip freeze 47 | 48 | - name: Install PennyLane and Plugin 49 | run: | 50 | pip install pennylane git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }} 51 | 52 | - uses: actions/checkout@v2 53 | with: 54 | repository: ${{ env.PLUGIN_REPO }} 55 | path: plugin_repo 56 | ref: ${{ env.PLUGIN_BRANCH }} 57 | - name: Run PennyLane device integration tests 58 | run: | 59 | if ! [ -x "$(command -v pl-device-test)" ]; then 60 | echo 'Error: Version of PennyLane does not provide device integration tests.' >&2 61 | else 62 | pl-device-test --device=cirq.simulator --tb=short --skip-ops --shots=None 63 | pl-device-test --device=cirq.simulator --tb=short --skip-ops --shots=20000 64 | pl-device-test --device=cirq.mixedsimulator --tb=short --skip-ops --shots=None 65 | pl-device-test --device=cirq.mixedsimulator --tb=short --skip-ops --shots=20000 66 | pl-device-test --device=cirq.pasqal --tb=short --skip-ops --analytic=False --shots=20000 --device-kwargs control_radius=2. 67 | pl-device-test --device=cirq.qsim --tb=short --skip-ops --analytic=False --shots=20000 68 | fi 69 | 70 | - name: Run plugin tests 71 | run: python -m pytest plugin_repo/tests --tb=short 72 | -------------------------------------------------------------------------------- /.github/workflows/cirq-stable-latest.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane latest 2 | 3 | name: cirq-stable-latest 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-cirq 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_cirq 18 | PENNYLANE_BRANCH: master 19 | 20 | 21 | jobs: 22 | tests: 23 | runs-on: ubuntu-latest 24 | 25 | strategy: 26 | fail-fast: false 27 | 28 | steps: 29 | - name: Cancel Previous Runs 30 | uses: styfle/cancel-workflow-action@0.4.1 31 | with: 32 | access_token: ${{ github.token }} 33 | 34 | - name: Set up Python 35 | uses: actions/setup-python@v2 36 | with: 37 | python-version: "3.11" 38 | 39 | - name: Install requirements 40 | run: | 41 | pip install --upgrade pip 42 | pip install --upgrade cirq 43 | pip install --upgrade qsimcirq 44 | pip install 'pytest<8.1.0' 45 | pip install pytest-mock pytest-cov flaky pytest-benchmark 46 | pip freeze 47 | 48 | - name: Install PennyLane and Plugin 49 | run: | 50 | pip install git+https://github.com/PennyLaneAI/pennylane.git \ 51 | ${{ env.PLUGIN_PACKAGE }} --upgrade 52 | 53 | - name: Get plugin version 54 | id: plugin-version 55 | run: | 56 | PLUGIN_VERSION=$(python -c "import pkg_resources as pkg; print(pkg.get_distribution('${{ env.PLUGIN_PACKAGE }}').version)") 57 | echo "version=$PLUGIN_VERSION" >> $GITHUB_OUTPUT 58 | 59 | - uses: actions/checkout@v2 60 | with: 61 | repository: ${{ env.PLUGIN_REPO }} 62 | path: plugin_repo 63 | ref: v${{ steps.plugin-version.outputs.version }} 64 | 65 | - name: Run PennyLane device integration tests 66 | run: | 67 | pl-device-test --device=cirq.simulator --tb=short --skip-ops --shots=None 68 | pl-device-test --device=cirq.simulator --tb=short --skip-ops --shots=20000 69 | pl-device-test --device=cirq.mixedsimulator --tb=short --skip-ops --shots=None 70 | pl-device-test --device=cirq.mixedsimulator --tb=short --skip-ops --shots=20000 71 | pl-device-test --device=cirq.pasqal --tb=short --skip-ops --analytic=False --shots=20000 --device-kwargs control_radius=2. 72 | pl-device-test --device=cirq.qsim --tb=short --skip-ops --analytic=False --shots=20000 73 | 74 | - name: Run plugin tests 75 | run: | 76 | python -m pytest plugin_repo/tests --tb=short \ 77 | -W "error::pennylane.PennyLaneDeprecationWarning" 78 | -------------------------------------------------------------------------------- /.github/workflows/cirq-stable-stable.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane stable 2 | 3 | name: cirq-stable-stable 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * 0' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-cirq 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_cirq 18 | PENNYLANE_BRANCH: master 19 | 20 | 21 | jobs: 22 | tests: 23 | runs-on: ubuntu-latest 24 | 25 | strategy: 26 | fail-fast: false 27 | 28 | steps: 29 | - name: Cancel Previous Runs 30 | uses: styfle/cancel-workflow-action@0.4.1 31 | with: 32 | access_token: ${{ github.token }} 33 | 34 | - name: Set up Python 35 | uses: actions/setup-python@v2 36 | with: 37 | python-version: "3.11" 38 | 39 | - name: Install requirements 40 | run: | 41 | pip install --upgrade pip 42 | pip install --upgrade cirq 43 | pip install --upgrade qsimcirq 44 | pip install 'pytest<8.1.0' 45 | pip install pytest-mock pytest-cov flaky pytest-benchmark 46 | pip freeze 47 | 48 | - name: Install PennyLane and Plugin 49 | run: | 50 | pip install pennylane ${{ env.PLUGIN_PACKAGE }} --upgrade 51 | pip freeze 52 | 53 | - name: Get plugin version 54 | id: plugin-version 55 | run: | 56 | PLUGIN_VERSION=$(python -c "import pkg_resources as pkg; print(pkg.get_distribution('${{ env.PLUGIN_PACKAGE }}').version)") 57 | echo "version=$PLUGIN_VERSION" >> $GITHUB_OUTPUT 58 | 59 | - uses: actions/checkout@v2 60 | with: 61 | repository: ${{ env.PLUGIN_REPO }} 62 | path: plugin_repo 63 | ref: v${{ steps.plugin-version.outputs.version }} 64 | - name: Run PennyLane device integration tests 65 | run: | 66 | if ! [ -x "$(command -v pl-device-test)" ]; then 67 | echo 'Error: Version of PennyLane does not provide device integration tests.' >&2 68 | else 69 | pl-device-test --device=cirq.simulator --tb=short --skip-ops --shots=None 70 | pl-device-test --device=cirq.simulator --tb=short --skip-ops --shots=20000 71 | pl-device-test --device=cirq.mixedsimulator --tb=short --skip-ops --shots=None 72 | pl-device-test --device=cirq.mixedsimulator --tb=short --skip-ops --shots=20000 73 | pl-device-test --device=cirq.pasqal --tb=short --skip-ops --analytic=False --shots=20000 --device-kwargs control_radius=2. 74 | pl-device-test --device=cirq.qsim --tb=short --skip-ops --analytic=False --shots=20000 75 | fi 76 | 77 | - name: Run plugin tests 78 | run: python -m pytest plugin_repo/tests --tb=short 79 | -------------------------------------------------------------------------------- /.github/workflows/ensure_compiled.yml: -------------------------------------------------------------------------------- 1 | name: Ensure templates are not manually changed 2 | on: 3 | push: 4 | branches: 5 | - master 6 | pull_request: 7 | 8 | jobs: 9 | check-diff: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v1 14 | 15 | - name: Compile and check for changes files 16 | run: python compile.py && git diff --quiet 17 | -------------------------------------------------------------------------------- /.github/workflows/ionq-latest-latest.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane latest 2 | 3 | name: ionq-latest-latest 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-ionq 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_ionq 18 | PENNYLANE_BRANCH: master 19 | IONQ_API_KEY: ${{ secrets.IONQ_API_KEY }} 20 | 21 | 22 | jobs: 23 | tests: 24 | runs-on: ubuntu-latest 25 | 26 | strategy: 27 | fail-fast: false 28 | 29 | steps: 30 | - name: Cancel Previous Runs 31 | uses: styfle/cancel-workflow-action@0.4.1 32 | with: 33 | access_token: ${{ github.token }} 34 | 35 | - name: Set up Python 36 | uses: actions/setup-python@v2 37 | with: 38 | python-version: "3.10" 39 | 40 | - name: Install requirements 41 | run: | 42 | pip install --upgrade pip 43 | pip install 'pytest<8.1.0' 44 | pip install pytest-mock pytest-cov flaky pytest-benchmark 45 | pip freeze 46 | 47 | - name: Install PennyLane and Plugin 48 | run: | 49 | pip install git+https://github.com/PennyLaneAI/pennylane.git \ 50 | git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }} 51 | 52 | - uses: actions/checkout@v2 53 | with: 54 | repository: ${{ env.PLUGIN_REPO }} 55 | path: plugin_repo 56 | ref: ${{ env.PLUGIN_BRANCH }} 57 | 58 | - name: Run PennyLane device integration tests 59 | run: | 60 | pl-device-test --device=ionq.simulator --tb=short --skip-ops --shots=10000 61 | 62 | - name: Run plugin tests 63 | run: | 64 | python -m pytest plugin_repo/tests --tb=short \ 65 | -W "error::pennylane.PennyLaneDeprecationWarning" 66 | -------------------------------------------------------------------------------- /.github/workflows/ionq-latest-rc.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane release candidate 2 | 3 | name: ionq-latest-rc 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-ionq 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_ionq 18 | PENNYLANE_BRANCH: master 19 | IONQ_API_KEY: ${{ secrets.IONQ_API_KEY }} 20 | 21 | 22 | jobs: 23 | tests: 24 | runs-on: ubuntu-latest 25 | 26 | strategy: 27 | fail-fast: false 28 | 29 | steps: 30 | - name: Cancel Previous Runs 31 | uses: styfle/cancel-workflow-action@0.4.1 32 | with: 33 | access_token: ${{ github.token }} 34 | 35 | - name: Set up Python 36 | uses: actions/setup-python@v2 37 | with: 38 | python-version: "3.10" 39 | 40 | - name: Install requirements 41 | run: | 42 | pip install --upgrade pip 43 | pip install 'pytest<8.1.0' 44 | pip install pytest-mock pytest-cov flaky pytest-benchmark 45 | pip freeze 46 | 47 | - name: Install PennyLane and Plugin 48 | run: | 49 | pip install git+https://github.com/PennyLaneAI/pennylane.git@v0.41.0-rc0 \ 50 | git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }} 51 | 52 | - uses: actions/checkout@v2 53 | with: 54 | repository: ${{ env.PLUGIN_REPO }} 55 | path: plugin_repo 56 | ref: ${{ env.PLUGIN_BRANCH }} 57 | 58 | - name: Run PennyLane device integration tests 59 | run: | 60 | pl-device-test --device=ionq.simulator --tb=short --skip-ops --shots=10000 61 | 62 | - name: Run plugin tests 63 | run: python -m pytest plugin_repo/tests --tb=short 64 | -------------------------------------------------------------------------------- /.github/workflows/ionq-latest-stable.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane stable 2 | 3 | name: ionq-latest-stable 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * 0' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-ionq 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_ionq 18 | PENNYLANE_BRANCH: master 19 | IONQ_API_KEY: ${{ secrets.IONQ_API_KEY }} 20 | 21 | 22 | jobs: 23 | tests: 24 | runs-on: ubuntu-latest 25 | 26 | strategy: 27 | fail-fast: false 28 | 29 | steps: 30 | - name: Cancel Previous Runs 31 | uses: styfle/cancel-workflow-action@0.4.1 32 | with: 33 | access_token: ${{ github.token }} 34 | 35 | - name: Set up Python 36 | uses: actions/setup-python@v2 37 | with: 38 | python-version: "3.10" 39 | 40 | - name: Install requirements 41 | run: | 42 | pip install --upgrade pip 43 | pip install 'pytest<8.1.0' 44 | pip install pytest-mock pytest-cov flaky pytest-benchmark 45 | pip freeze 46 | 47 | - name: Install PennyLane and Plugin 48 | run: | 49 | pip install pennylane git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }} 50 | 51 | - uses: actions/checkout@v2 52 | with: 53 | repository: ${{ env.PLUGIN_REPO }} 54 | path: plugin_repo 55 | ref: ${{ env.PLUGIN_BRANCH }} 56 | - name: Run PennyLane device integration tests 57 | run: | 58 | if ! [ -x "$(command -v pl-device-test)" ]; then 59 | echo 'Error: Version of PennyLane does not provide device integration tests.' >&2 60 | else 61 | pl-device-test --device=ionq.simulator --tb=short --skip-ops --shots=10000 62 | fi 63 | 64 | - name: Run plugin tests 65 | run: python -m pytest plugin_repo/tests --tb=short 66 | -------------------------------------------------------------------------------- /.github/workflows/ionq-stable-latest.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane latest 2 | 3 | name: ionq-stable-latest 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-ionq 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_ionq 18 | PENNYLANE_BRANCH: master 19 | IONQ_API_KEY: ${{ secrets.IONQ_API_KEY }} 20 | 21 | 22 | jobs: 23 | tests: 24 | runs-on: ubuntu-latest 25 | 26 | strategy: 27 | fail-fast: false 28 | 29 | steps: 30 | - name: Cancel Previous Runs 31 | uses: styfle/cancel-workflow-action@0.4.1 32 | with: 33 | access_token: ${{ github.token }} 34 | 35 | - name: Set up Python 36 | uses: actions/setup-python@v2 37 | with: 38 | python-version: "3.10" 39 | 40 | - name: Install requirements 41 | run: | 42 | pip install --upgrade pip 43 | pip install 'pytest<8.1.0' 44 | pip install pytest-mock pytest-cov flaky pytest-benchmark 45 | pip freeze 46 | 47 | - name: Install PennyLane and Plugin 48 | run: | 49 | pip install git+https://github.com/PennyLaneAI/pennylane.git \ 50 | ${{ env.PLUGIN_PACKAGE }} --upgrade 51 | 52 | - name: Get plugin version 53 | id: plugin-version 54 | run: | 55 | PLUGIN_VERSION=$(python -c "import pkg_resources as pkg; print(pkg.get_distribution('${{ env.PLUGIN_PACKAGE }}').version)") 56 | echo "version=$PLUGIN_VERSION" >> $GITHUB_OUTPUT 57 | 58 | - uses: actions/checkout@v2 59 | with: 60 | repository: ${{ env.PLUGIN_REPO }} 61 | path: plugin_repo 62 | ref: v${{ steps.plugin-version.outputs.version }} 63 | 64 | - name: Run PennyLane device integration tests 65 | run: | 66 | pl-device-test --device=ionq.simulator --tb=short --skip-ops --shots=10000 67 | 68 | - name: Run plugin tests 69 | run: | 70 | python -m pytest plugin_repo/tests --tb=short \ 71 | -W "error::pennylane.PennyLaneDeprecationWarning" 72 | -------------------------------------------------------------------------------- /.github/workflows/ionq-stable-stable.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane stable 2 | 3 | name: ionq-stable-stable 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * 0' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-ionq 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_ionq 18 | PENNYLANE_BRANCH: master 19 | IONQ_API_KEY: ${{ secrets.IONQ_API_KEY }} 20 | 21 | 22 | jobs: 23 | tests: 24 | runs-on: ubuntu-latest 25 | 26 | strategy: 27 | fail-fast: false 28 | 29 | steps: 30 | - name: Cancel Previous Runs 31 | uses: styfle/cancel-workflow-action@0.4.1 32 | with: 33 | access_token: ${{ github.token }} 34 | 35 | - name: Set up Python 36 | uses: actions/setup-python@v2 37 | with: 38 | python-version: "3.10" 39 | 40 | - name: Install requirements 41 | run: | 42 | pip install --upgrade pip 43 | pip install 'pytest<8.1.0' 44 | pip install pytest-mock pytest-cov flaky pytest-benchmark 45 | pip freeze 46 | 47 | - name: Install PennyLane and Plugin 48 | run: | 49 | pip install pennylane ${{ env.PLUGIN_PACKAGE }} --upgrade 50 | pip freeze 51 | 52 | - name: Get plugin version 53 | id: plugin-version 54 | run: | 55 | PLUGIN_VERSION=$(python -c "import pkg_resources as pkg; print(pkg.get_distribution('${{ env.PLUGIN_PACKAGE }}').version)") 56 | echo "version=$PLUGIN_VERSION" >> $GITHUB_OUTPUT 57 | 58 | - uses: actions/checkout@v2 59 | with: 60 | repository: ${{ env.PLUGIN_REPO }} 61 | path: plugin_repo 62 | ref: v${{ steps.plugin-version.outputs.version }} 63 | - name: Run PennyLane device integration tests 64 | run: | 65 | if ! [ -x "$(command -v pl-device-test)" ]; then 66 | echo 'Error: Version of PennyLane does not provide device integration tests.' >&2 67 | else 68 | pl-device-test --device=ionq.simulator --tb=short --skip-ops --shots=10000 69 | fi 70 | 71 | - name: Run plugin tests 72 | run: python -m pytest plugin_repo/tests --tb=short 73 | -------------------------------------------------------------------------------- /.github/workflows/lightning-latest-rc.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane release candidate 2 | 3 | name: lightning-latest-rc 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-lightning 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_lightning 18 | PENNYLANE_BRANCH: master 19 | GCC_VERSION: 11 20 | 21 | 22 | jobs: 23 | tests: 24 | runs-on: ubuntu-latest 25 | 26 | strategy: 27 | fail-fast: false 28 | matrix: 29 | pl_backend: ["lightning_qubit", "lightning_kokkos"] 30 | 31 | steps: 32 | - name: Cancel Previous Runs 33 | uses: styfle/cancel-workflow-action@0.4.1 34 | with: 35 | access_token: ${{ github.token }} 36 | 37 | - name: Set up Python 38 | uses: actions/setup-python@v2 39 | with: 40 | python-version: "3.10" 41 | 42 | - name: Install buildtools & compilers 43 | run: | 44 | sudo apt-get update && sudo apt-get -y -q install cmake gcc-${{ env.GCC_VERSION }} g++-${{ env.GCC_VERSION }} ninja-build 45 | 46 | - name: Install requirements 47 | run: | 48 | pip install --upgrade pip 49 | pip install --upgrade pybind11 50 | pip install 'pytest<8.1.0' 51 | pip install pytest-mock pytest-cov flaky pytest-benchmark 52 | pip freeze 53 | 54 | - name: Install PennyLane 55 | run: | 56 | pip install git+https://github.com/PennyLaneAI/pennylane.git@v0.41.0-rc0 57 | 58 | - uses: actions/checkout@v2 59 | with: 60 | repository: ${{ env.PLUGIN_REPO }} 61 | path: plugin_repo 62 | ref: ${{ env.PLUGIN_BRANCH }} 63 | 64 | - name: Install Plugin 65 | run: | 66 | cd plugin_repo 67 | SKIP_COMPILATION=True PL_BACKEND=lightning_qubit pip install . -vv 68 | PL_BACKEND=${{ matrix.pl_backend }} python scripts/configure_pyproject_toml.py 69 | PL_BACKEND=${{ matrix.pl_backend }} pip install . -vv 70 | 71 | - name: Run PennyLane device integration tests 72 | run: | 73 | DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"` 74 | pl-device-test --device ${DEVICENAME} --shots=None --skip-ops 75 | pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000 76 | 77 | - name: Run plugin tests 78 | run: | 79 | DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"` 80 | PL_DEVICE=${DEVICENAME} python -m pytest plugin_repo/tests --tb=short 81 | -------------------------------------------------------------------------------- /.github/workflows/old-workflow: -------------------------------------------------------------------------------- 1 | name: qiskit-stable 2 | on: 3 | push: 4 | pull_request: 5 | schedule: 6 | - cron: '0 0 * * *' 7 | workflow_dispatch: 8 | 9 | 10 | env: 11 | PLUGIN_REPO: PennyLaneAI/pennylane-qiskit 12 | PLUGIN_BRANCH: master 13 | PLUGIN_PACKAGE: pennylane_qiskit 14 | PENNYLANE_BRANCH: device-test-cli 15 | 16 | 17 | jobs: 18 | tests: 19 | runs-on: ubuntu-latest 20 | 21 | strategy: 22 | fail-fast: false 23 | matrix: 24 | config: 25 | - {pennylane: git, plugin: pypi} 26 | 27 | steps: 28 | - name: Cancel Previous Runs 29 | uses: styfle/cancel-workflow-action@0.4.1 30 | with: 31 | access_token: ${{ github.token }} 32 | 33 | - name: Set up Python 34 | uses: actions/setup-python@v2 35 | with: 36 | python-version: 3.7 37 | 38 | - name: Install requirements 39 | run: | 40 | pip install --upgrade pip 41 | pip install --upgrade qiskit 42 | pip install pyscf==1.7.2 43 | pip install pytest pytest-mock pytest-cov flaky pytest-benchmark 44 | pip freeze 45 | 46 | - name: Install Plugin 47 | run: | 48 | if [ "${{ matrix.config.plugin }}" == "git" ]; then 49 | pip install git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }} 50 | elif [ "${{ matrix.config.plugin }}" == "pypi" ]; then 51 | pip install ${{ env.PLUGIN_PACKAGE }} 52 | fi 53 | 54 | - name: Install PennyLane 55 | if: contains(matrix.config.pennylane, 'git') 56 | run: | 57 | pip uninstall -y pennylane 58 | pip install git+https://github.com/PennyLaneAI/pennylane.git@${{ env.PENNYLANE_BRANCH }} 59 | 60 | - name: Get plugin version 61 | id: plugin-version 62 | if: contains(matrix.config.plugin, 'pypi') 63 | run: | 64 | PLUGIN_VERSION=$(python -c "import pkg_resources as pkg; print(pkg.get_distribution('${{ env.PLUGIN_PACKAGE }}').version)") 65 | echo "version=$PLUGIN_VERSION" >> $GITHUB_OUTPUT 66 | 67 | - uses: actions/checkout@v2 68 | if: contains(matrix.config.plugin, 'git') 69 | with: 70 | repository: ${{ env.PLUGIN_REPO }} 71 | path: plugin_repo 72 | ref: ${{ env.PLUGIN_BRANCH }} 73 | 74 | - uses: actions/checkout@v2 75 | if: contains(matrix.config.plugin, 'pypi') 76 | with: 77 | repository: ${{ env.PLUGIN_REPO }} 78 | path: plugin_repo 79 | ref: v${{ steps.plugin-version.outputs.version }} 80 | 81 | - name: Run PennyLane device integration tests 82 | # Remove this if statement when the device tests are released on PyPI 83 | if: "contains(matrix.config.pennylane, 'git')" 84 | run: | 85 | pl-device-test --device="qiskit.basicaer" --tb=short --skip-ops --shots=8000 86 | pl-device-test --device="qiskit.aer" --tb=short --skip-ops --shots=8000 87 | 88 | - name: Run plugin tests 89 | run: python -m pytest plugin_repo/tests --tb=short 90 | -------------------------------------------------------------------------------- /.github/workflows/qiskit-latest-latest.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane latest 2 | 3 | name: qiskit-latest-latest 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-qiskit 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_qiskit 18 | PENNYLANE_BRANCH: master 19 | IBMQX_TOKEN: ${{ secrets.IBMQX_TOKEN }} 20 | 21 | 22 | jobs: 23 | tests: 24 | runs-on: ubuntu-latest 25 | 26 | strategy: 27 | fail-fast: false 28 | 29 | steps: 30 | - name: Cancel Previous Runs 31 | uses: styfle/cancel-workflow-action@0.4.1 32 | with: 33 | access_token: ${{ github.token }} 34 | 35 | - name: Set up Python 36 | uses: actions/setup-python@v2 37 | with: 38 | python-version: "3.10" 39 | 40 | - name: Install requirements 41 | run: | 42 | pip install --upgrade pip 43 | pip install --upgrade qiskit 44 | pip install --upgrade pyscf 45 | pip install 'pytest<8.1.0' 46 | pip install pytest-mock pytest-cov flaky pytest-benchmark 47 | pip freeze 48 | 49 | - name: Install PennyLane and Plugin 50 | run: | 51 | pip install git+https://github.com/PennyLaneAI/pennylane.git \ 52 | git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }} 53 | 54 | - uses: actions/checkout@v2 55 | with: 56 | repository: ${{ env.PLUGIN_REPO }} 57 | path: plugin_repo 58 | ref: ${{ env.PLUGIN_BRANCH }} 59 | 60 | - name: Run PennyLane device integration tests 61 | run: | 62 | pl-device-test --device=qiskit.basicsim --tb=short --skip-ops --shots=20000 --device-kwargs backend=basic_simulator 63 | pl-device-test --device=qiskit.aer --tb=short --skip-ops --shots=20000 64 | pl-device-test --device=qiskit.aer --tb=short --skip-ops --shots=None --device-kwargs backend=statevector_simulator 65 | pl-device-test --device=qiskit.aer --tb=short --skip-ops --shots=None --device-kwargs backend=unitary_simulator 66 | 67 | - name: Run plugin tests 68 | run: | 69 | python -m pytest plugin_repo/tests --tb=short \ 70 | -W "error::pennylane.PennyLaneDeprecationWarning" 71 | -------------------------------------------------------------------------------- /.github/workflows/qiskit-latest-rc.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane release candidate 2 | 3 | name: qiskit-latest-rc 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-qiskit 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_qiskit 18 | PENNYLANE_BRANCH: master 19 | IBMQX_TOKEN: ${{ secrets.IBMQX_TOKEN }} 20 | 21 | 22 | jobs: 23 | tests: 24 | runs-on: ubuntu-latest 25 | 26 | strategy: 27 | fail-fast: false 28 | 29 | steps: 30 | - name: Cancel Previous Runs 31 | uses: styfle/cancel-workflow-action@0.4.1 32 | with: 33 | access_token: ${{ github.token }} 34 | 35 | - name: Set up Python 36 | uses: actions/setup-python@v2 37 | with: 38 | python-version: "3.10" 39 | 40 | - name: Install requirements 41 | run: | 42 | pip install --upgrade pip 43 | pip install --upgrade qiskit 44 | pip install --upgrade pyscf 45 | pip install 'pytest<8.1.0' 46 | pip install pytest-mock pytest-cov flaky pytest-benchmark 47 | pip freeze 48 | 49 | - name: Install PennyLane and Plugin 50 | run: | 51 | pip install git+https://github.com/PennyLaneAI/pennylane.git@v0.41.0-rc0 \ 52 | git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }} 53 | 54 | - uses: actions/checkout@v2 55 | with: 56 | repository: ${{ env.PLUGIN_REPO }} 57 | path: plugin_repo 58 | ref: ${{ env.PLUGIN_BRANCH }} 59 | 60 | - name: Run PennyLane device integration tests 61 | run: | 62 | pl-device-test --device=qiskit.basicsim --tb=short --skip-ops --shots=20000 --device-kwargs backend=basic_simulator 63 | pl-device-test --device=qiskit.aer --tb=short --skip-ops --shots=20000 64 | pl-device-test --device=qiskit.aer --tb=short --skip-ops --shots=None --device-kwargs backend=statevector_simulator 65 | pl-device-test --device=qiskit.aer --tb=short --skip-ops --shots=None --device-kwargs backend=unitary_simulator 66 | 67 | - name: Run plugin tests 68 | run: python -m pytest plugin_repo/tests --tb=short 69 | -------------------------------------------------------------------------------- /.github/workflows/qiskit-latest-stable.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane stable 2 | 3 | name: qiskit-latest-stable 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * 0' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-qiskit 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_qiskit 18 | PENNYLANE_BRANCH: master 19 | IBMQX_TOKEN: ${{ secrets.IBMQX_TOKEN }} 20 | 21 | 22 | jobs: 23 | tests: 24 | runs-on: ubuntu-latest 25 | 26 | strategy: 27 | fail-fast: false 28 | 29 | steps: 30 | - name: Cancel Previous Runs 31 | uses: styfle/cancel-workflow-action@0.4.1 32 | with: 33 | access_token: ${{ github.token }} 34 | 35 | - name: Set up Python 36 | uses: actions/setup-python@v2 37 | with: 38 | python-version: "3.10" 39 | 40 | - name: Install requirements 41 | run: | 42 | pip install --upgrade pip 43 | pip install --upgrade qiskit 44 | pip install --upgrade pyscf 45 | pip install 'pytest<8.1.0' 46 | pip install pytest-mock pytest-cov flaky pytest-benchmark 47 | pip freeze 48 | 49 | - name: Install PennyLane and Plugin 50 | run: | 51 | pip install pennylane git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }} 52 | 53 | - uses: actions/checkout@v2 54 | with: 55 | repository: ${{ env.PLUGIN_REPO }} 56 | path: plugin_repo 57 | ref: ${{ env.PLUGIN_BRANCH }} 58 | - name: Run PennyLane device integration tests 59 | run: | 60 | if ! [ -x "$(command -v pl-device-test)" ]; then 61 | echo 'Error: Version of PennyLane does not provide device integration tests.' >&2 62 | else 63 | pl-device-test --device=qiskit.basicsim --tb=short --skip-ops --shots=20000 --device-kwargs backend=basic_simulator 64 | pl-device-test --device=qiskit.aer --tb=short --skip-ops --shots=20000 65 | pl-device-test --device=qiskit.aer --tb=short --skip-ops --shots=None --device-kwargs backend=statevector_simulator 66 | pl-device-test --device=qiskit.aer --tb=short --skip-ops --shots=None --device-kwargs backend=unitary_simulator 67 | fi 68 | 69 | - name: Run plugin tests 70 | run: python -m pytest plugin_repo/tests --tb=short 71 | -------------------------------------------------------------------------------- /.github/workflows/qiskit-stable-latest.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane latest 2 | 3 | name: qiskit-stable-latest 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-qiskit 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_qiskit 18 | PENNYLANE_BRANCH: master 19 | IBMQX_TOKEN: ${{ secrets.IBMQX_TOKEN }} 20 | 21 | 22 | jobs: 23 | tests: 24 | runs-on: ubuntu-latest 25 | 26 | strategy: 27 | fail-fast: false 28 | 29 | steps: 30 | - name: Cancel Previous Runs 31 | uses: styfle/cancel-workflow-action@0.4.1 32 | with: 33 | access_token: ${{ github.token }} 34 | 35 | - name: Set up Python 36 | uses: actions/setup-python@v2 37 | with: 38 | python-version: "3.10" 39 | 40 | - name: Install requirements 41 | run: | 42 | pip install --upgrade pip 43 | pip install --upgrade qiskit 44 | pip install --upgrade pyscf 45 | pip install 'pytest<8.1.0' 46 | pip install pytest-mock pytest-cov flaky pytest-benchmark 47 | pip freeze 48 | 49 | - name: Install PennyLane and Plugin 50 | run: | 51 | pip install git+https://github.com/PennyLaneAI/pennylane.git \ 52 | ${{ env.PLUGIN_PACKAGE }} --upgrade 53 | 54 | - name: Get plugin version 55 | id: plugin-version 56 | run: | 57 | PLUGIN_VERSION=$(python -c "import pkg_resources as pkg; print(pkg.get_distribution('${{ env.PLUGIN_PACKAGE }}').version)") 58 | echo "version=$PLUGIN_VERSION" >> $GITHUB_OUTPUT 59 | 60 | - uses: actions/checkout@v2 61 | with: 62 | repository: ${{ env.PLUGIN_REPO }} 63 | path: plugin_repo 64 | ref: v${{ steps.plugin-version.outputs.version }} 65 | 66 | - name: Run PennyLane device integration tests 67 | run: | 68 | pl-device-test --device=qiskit.basicsim --tb=short --skip-ops --shots=20000 --device-kwargs backend=basic_simulator 69 | pl-device-test --device=qiskit.aer --tb=short --skip-ops --shots=20000 70 | pl-device-test --device=qiskit.aer --tb=short --skip-ops --shots=None --device-kwargs backend=statevector_simulator 71 | pl-device-test --device=qiskit.aer --tb=short --skip-ops --shots=None --device-kwargs backend=unitary_simulator 72 | 73 | - name: Run plugin tests 74 | run: | 75 | python -m pytest plugin_repo/tests --tb=short \ 76 | -W "error::pennylane.PennyLaneDeprecationWarning" 77 | -------------------------------------------------------------------------------- /.github/workflows/qiskit-stable-stable.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane stable 2 | 3 | name: qiskit-stable-stable 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * 0' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-qiskit 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_qiskit 18 | PENNYLANE_BRANCH: master 19 | IBMQX_TOKEN: ${{ secrets.IBMQX_TOKEN }} 20 | 21 | 22 | jobs: 23 | tests: 24 | runs-on: ubuntu-latest 25 | 26 | strategy: 27 | fail-fast: false 28 | 29 | steps: 30 | - name: Cancel Previous Runs 31 | uses: styfle/cancel-workflow-action@0.4.1 32 | with: 33 | access_token: ${{ github.token }} 34 | 35 | - name: Set up Python 36 | uses: actions/setup-python@v2 37 | with: 38 | python-version: "3.10" 39 | 40 | - name: Install requirements 41 | run: | 42 | pip install --upgrade pip 43 | pip install --upgrade qiskit 44 | pip install --upgrade pyscf 45 | pip install 'pytest<8.1.0' 46 | pip install pytest-mock pytest-cov flaky pytest-benchmark 47 | pip freeze 48 | 49 | - name: Install PennyLane and Plugin 50 | run: | 51 | pip install pennylane ${{ env.PLUGIN_PACKAGE }} --upgrade 52 | pip freeze 53 | 54 | - name: Get plugin version 55 | id: plugin-version 56 | run: | 57 | PLUGIN_VERSION=$(python -c "import pkg_resources as pkg; print(pkg.get_distribution('${{ env.PLUGIN_PACKAGE }}').version)") 58 | echo "version=$PLUGIN_VERSION" >> $GITHUB_OUTPUT 59 | 60 | - uses: actions/checkout@v2 61 | with: 62 | repository: ${{ env.PLUGIN_REPO }} 63 | path: plugin_repo 64 | ref: v${{ steps.plugin-version.outputs.version }} 65 | - name: Run PennyLane device integration tests 66 | run: | 67 | if ! [ -x "$(command -v pl-device-test)" ]; then 68 | echo 'Error: Version of PennyLane does not provide device integration tests.' >&2 69 | else 70 | pl-device-test --device=qiskit.basicsim --tb=short --skip-ops --shots=20000 --device-kwargs backend=basic_simulator 71 | pl-device-test --device=qiskit.aer --tb=short --skip-ops --shots=20000 72 | pl-device-test --device=qiskit.aer --tb=short --skip-ops --shots=None --device-kwargs backend=statevector_simulator 73 | pl-device-test --device=qiskit.aer --tb=short --skip-ops --shots=None --device-kwargs backend=unitary_simulator 74 | fi 75 | 76 | - name: Run plugin tests 77 | run: python -m pytest plugin_repo/tests --tb=short 78 | -------------------------------------------------------------------------------- /.github/workflows/qulacs-latest-latest.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane latest 2 | 3 | name: qulacs-latest-latest 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-qulacs 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_qulacs 18 | PENNYLANE_BRANCH: master 19 | 20 | 21 | jobs: 22 | tests: 23 | runs-on: ubuntu-latest 24 | 25 | strategy: 26 | fail-fast: false 27 | 28 | steps: 29 | - name: Cancel Previous Runs 30 | uses: styfle/cancel-workflow-action@0.4.1 31 | with: 32 | access_token: ${{ github.token }} 33 | 34 | - name: Set up Python 35 | uses: actions/setup-python@v2 36 | with: 37 | python-version: "3.10" 38 | 39 | - name: Install requirements 40 | run: | 41 | pip install --upgrade pip 42 | pip install --upgrade qulacs 43 | pip install 'pytest<8.1.0' 44 | pip install pytest-mock pytest-cov flaky pytest-benchmark 45 | pip freeze 46 | 47 | - name: Install PennyLane and Plugin 48 | run: | 49 | pip install git+https://github.com/PennyLaneAI/pennylane.git \ 50 | git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }} 51 | 52 | - uses: actions/checkout@v2 53 | with: 54 | repository: ${{ env.PLUGIN_REPO }} 55 | path: plugin_repo 56 | ref: ${{ env.PLUGIN_BRANCH }} 57 | 58 | - name: Run PennyLane device integration tests 59 | run: | 60 | pl-device-test --device=qulacs.simulator --tb=short --skip-ops --shots=None 61 | pl-device-test --device=qulacs.simulator --tb=short --skip-ops --shots=20000 62 | 63 | - name: Run plugin tests 64 | run: | 65 | python -m pytest plugin_repo/tests --tb=short \ 66 | -W "error::pennylane.PennyLaneDeprecationWarning" 67 | -------------------------------------------------------------------------------- /.github/workflows/qulacs-latest-rc.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane release candidate 2 | 3 | name: qulacs-latest-rc 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-qulacs 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_qulacs 18 | PENNYLANE_BRANCH: master 19 | 20 | 21 | jobs: 22 | tests: 23 | runs-on: ubuntu-latest 24 | 25 | strategy: 26 | fail-fast: false 27 | 28 | steps: 29 | - name: Cancel Previous Runs 30 | uses: styfle/cancel-workflow-action@0.4.1 31 | with: 32 | access_token: ${{ github.token }} 33 | 34 | - name: Set up Python 35 | uses: actions/setup-python@v2 36 | with: 37 | python-version: "3.10" 38 | 39 | - name: Install requirements 40 | run: | 41 | pip install --upgrade pip 42 | pip install --upgrade qulacs 43 | pip install 'pytest<8.1.0' 44 | pip install pytest-mock pytest-cov flaky pytest-benchmark 45 | pip freeze 46 | 47 | - name: Install PennyLane and Plugin 48 | run: | 49 | pip install git+https://github.com/PennyLaneAI/pennylane.git@v0.41.0-rc0 \ 50 | git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }} 51 | 52 | - uses: actions/checkout@v2 53 | with: 54 | repository: ${{ env.PLUGIN_REPO }} 55 | path: plugin_repo 56 | ref: ${{ env.PLUGIN_BRANCH }} 57 | 58 | - name: Run PennyLane device integration tests 59 | run: | 60 | pl-device-test --device=qulacs.simulator --tb=short --skip-ops --shots=None 61 | pl-device-test --device=qulacs.simulator --tb=short --skip-ops --shots=20000 62 | 63 | - name: Run plugin tests 64 | run: python -m pytest plugin_repo/tests --tb=short 65 | -------------------------------------------------------------------------------- /.github/workflows/qulacs-latest-stable.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane stable 2 | 3 | name: qulacs-latest-stable 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * 0' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-qulacs 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_qulacs 18 | PENNYLANE_BRANCH: master 19 | 20 | 21 | jobs: 22 | tests: 23 | runs-on: ubuntu-latest 24 | 25 | strategy: 26 | fail-fast: false 27 | 28 | steps: 29 | - name: Cancel Previous Runs 30 | uses: styfle/cancel-workflow-action@0.4.1 31 | with: 32 | access_token: ${{ github.token }} 33 | 34 | - name: Set up Python 35 | uses: actions/setup-python@v2 36 | with: 37 | python-version: "3.10" 38 | 39 | - name: Install requirements 40 | run: | 41 | pip install --upgrade pip 42 | pip install --upgrade qulacs 43 | pip install 'pytest<8.1.0' 44 | pip install pytest-mock pytest-cov flaky pytest-benchmark 45 | pip freeze 46 | 47 | - name: Install PennyLane and Plugin 48 | run: | 49 | pip install pennylane git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }} 50 | 51 | - uses: actions/checkout@v2 52 | with: 53 | repository: ${{ env.PLUGIN_REPO }} 54 | path: plugin_repo 55 | ref: ${{ env.PLUGIN_BRANCH }} 56 | - name: Run PennyLane device integration tests 57 | run: | 58 | if ! [ -x "$(command -v pl-device-test)" ]; then 59 | echo 'Error: Version of PennyLane does not provide device integration tests.' >&2 60 | else 61 | pl-device-test --device=qulacs.simulator --tb=short --skip-ops --shots=None 62 | pl-device-test --device=qulacs.simulator --tb=short --skip-ops --shots=20000 63 | fi 64 | 65 | - name: Run plugin tests 66 | run: python -m pytest plugin_repo/tests --tb=short 67 | -------------------------------------------------------------------------------- /.github/workflows/qulacs-stable-latest.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane latest 2 | 3 | name: qulacs-stable-latest 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-qulacs 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_qulacs 18 | PENNYLANE_BRANCH: master 19 | 20 | 21 | jobs: 22 | tests: 23 | runs-on: ubuntu-latest 24 | 25 | strategy: 26 | fail-fast: false 27 | 28 | steps: 29 | - name: Cancel Previous Runs 30 | uses: styfle/cancel-workflow-action@0.4.1 31 | with: 32 | access_token: ${{ github.token }} 33 | 34 | - name: Set up Python 35 | uses: actions/setup-python@v2 36 | with: 37 | python-version: "3.10" 38 | 39 | - name: Install requirements 40 | run: | 41 | pip install --upgrade pip 42 | pip install --upgrade qulacs 43 | pip install 'pytest<8.1.0' 44 | pip install pytest-mock pytest-cov flaky pytest-benchmark 45 | pip freeze 46 | 47 | - name: Install PennyLane and Plugin 48 | run: | 49 | pip install git+https://github.com/PennyLaneAI/pennylane.git \ 50 | ${{ env.PLUGIN_PACKAGE }} --upgrade 51 | 52 | - name: Get plugin version 53 | id: plugin-version 54 | run: | 55 | PLUGIN_VERSION=$(python -c "import pkg_resources as pkg; print(pkg.get_distribution('${{ env.PLUGIN_PACKAGE }}').version)") 56 | echo "version=$PLUGIN_VERSION" >> $GITHUB_OUTPUT 57 | 58 | - uses: actions/checkout@v2 59 | with: 60 | repository: ${{ env.PLUGIN_REPO }} 61 | path: plugin_repo 62 | ref: v${{ steps.plugin-version.outputs.version }} 63 | 64 | - name: Run PennyLane device integration tests 65 | run: | 66 | pl-device-test --device=qulacs.simulator --tb=short --skip-ops --shots=None 67 | pl-device-test --device=qulacs.simulator --tb=short --skip-ops --shots=20000 68 | 69 | - name: Run plugin tests 70 | run: | 71 | python -m pytest plugin_repo/tests --tb=short \ 72 | -W "error::pennylane.PennyLaneDeprecationWarning" 73 | -------------------------------------------------------------------------------- /.github/workflows/qulacs-stable-stable.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane stable 2 | 3 | name: qulacs-stable-stable 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * 0' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: PennyLaneAI/pennylane-qulacs 16 | PLUGIN_BRANCH: master 17 | PLUGIN_PACKAGE: pennylane_qulacs 18 | PENNYLANE_BRANCH: master 19 | 20 | 21 | jobs: 22 | tests: 23 | runs-on: ubuntu-latest 24 | 25 | strategy: 26 | fail-fast: false 27 | 28 | steps: 29 | - name: Cancel Previous Runs 30 | uses: styfle/cancel-workflow-action@0.4.1 31 | with: 32 | access_token: ${{ github.token }} 33 | 34 | - name: Set up Python 35 | uses: actions/setup-python@v2 36 | with: 37 | python-version: "3.10" 38 | 39 | - name: Install requirements 40 | run: | 41 | pip install --upgrade pip 42 | pip install --upgrade qulacs 43 | pip install 'pytest<8.1.0' 44 | pip install pytest-mock pytest-cov flaky pytest-benchmark 45 | pip freeze 46 | 47 | - name: Install PennyLane and Plugin 48 | run: | 49 | pip install pennylane ${{ env.PLUGIN_PACKAGE }} --upgrade 50 | pip freeze 51 | 52 | - name: Get plugin version 53 | id: plugin-version 54 | run: | 55 | PLUGIN_VERSION=$(python -c "import pkg_resources as pkg; print(pkg.get_distribution('${{ env.PLUGIN_PACKAGE }}').version)") 56 | echo "version=$PLUGIN_VERSION" >> $GITHUB_OUTPUT 57 | 58 | - uses: actions/checkout@v2 59 | with: 60 | repository: ${{ env.PLUGIN_REPO }} 61 | path: plugin_repo 62 | ref: v${{ steps.plugin-version.outputs.version }} 63 | - name: Run PennyLane device integration tests 64 | run: | 65 | if ! [ -x "$(command -v pl-device-test)" ]; then 66 | echo 'Error: Version of PennyLane does not provide device integration tests.' >&2 67 | else 68 | pl-device-test --device=qulacs.simulator --tb=short --skip-ops --shots=None 69 | pl-device-test --device=qulacs.simulator --tb=short --skip-ops --shots=20000 70 | fi 71 | 72 | - name: Run plugin tests 73 | run: python -m pytest plugin_repo/tests --tb=short 74 | -------------------------------------------------------------------------------- /.github/workflows/scripts/unique_warning_reporter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file determines and counts the unique warnings that appear in the test suite using the 4 | # warnings-as-errors action runs. The volume of each reported warning can be used to indicate 5 | # the severity or importance of rectification. 6 | 7 | JOBID=$(gh run list -w "Test-suite with Python warnings as errors" -L 1 --json databaseId -q '.[0].databaseId') 8 | echo "View latest job at https://github.com/PennyLaneAI/pennylane/actions/runs/$JOBID" 9 | gh run view $JOBID --log-failed >/tmp/job_$JOBID.out 10 | cat /tmp/job_$JOBID.out | grep "Warning:" | awk '{split($0,a,"Warning:"); print a[1]"Warning"}' | awk '{split($0,a," - "); print a[2]}' | sort -u >unique_wae.txt 11 | 12 | declare -A waeCounts 13 | 14 | while read -r line; do 15 | [[ -n "$line" && "$line" != [[:blank:]]* ]] && waeCounts["$line"]=$(cat /tmp/job_$JOBID.out | grep "$line" | wc -l) 16 | done unique_wae.json 26 | -------------------------------------------------------------------------------- /.github/workflows/workflow-wae-reporting.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for reporting the outcome of warnings-as-errors CI checks 2 | 3 | name: wae-reporting 4 | on: 5 | schedule: 6 | - cron: '35 8 * * 0' # Taken several hours after the weekly runs 7 | workflow_dispatch: 8 | 9 | 10 | jobs: 11 | wae-reporter: 12 | env: 13 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Checkout 17 | uses: actions/checkout@v4 18 | 19 | - name: Clone latest PennyLane 20 | run: git clone https://github.com/PennyLaneAI/pennylane 21 | 22 | - name: Generate WAE JSON 23 | run: | 24 | cd pennylane 25 | bash $GITHUB_WORKSPACE/.github/workflows/scripts/unique_warning_reporter.sh 26 | cp *.json $GITHUB_WORKSPACE 27 | 28 | - name: Store new JSON data 29 | env: 30 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 31 | run: | 32 | git config --local user.email 'github-actions[bot]@users.noreply.github.com' 33 | git config --local user.name "Update WAE data" 34 | git checkout -b wae_data 35 | git add *.json 36 | git commit -m "Check in WAE data" 37 | git tag -f wae_data_tag 38 | git push origin tag wae_data_tag --force 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Plugin Test Matrix 2 | 3 | This repository contains regularly scheduled continuous-integration for the official PennyLane plugins. 4 | 5 | The continuous integration is performed by GitHub actions. Tests are executed on every push to `master`, 6 | and are also run on a schedule of once per day. 7 | 8 | Finally, tests can be triggered manually via the 'Actions' tab. 9 | 10 | ## Testing matrix 11 | 12 | All entries in the matrix are tested against PennyLane latest (GitHub master). 13 | 14 | 15 | | | PyPI version | Stable plugin/stable PennyLane | Stable plugin/latest PennyLane | Latest plugin/ stable PennyLane | Latest plugin/latest PennyLane | 16 | | :-------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 17 | | [Qiskit](https://github.com/PennyLaneAI/pennylane-qiskit) | ![](https://img.shields.io/pypi/v/pennylane-qiskit?color=green&label=%20&style=flat-square) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/qiskit-stable-stable.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/qiskit-stable-stable.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/qiskit-stable-latest.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/qiskit-stable-latest.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/qiskit-latest-stable.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/qiskit-latest-stable.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/qiskit-latest-latest.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/qiskit-latest-latest.yml) | 18 | | [Cirq](https://github.com/PennyLaneAI/pennylane-cirq) | ![](https://img.shields.io/pypi/v/pennylane-cirq?color=green&label=%20&style=flat-square) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/cirq-stable-stable.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/cirq-stable-stable.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/cirq-stable-latest.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/cirq-stable-latest.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/cirq-latest-stable.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/cirq-latest-stable.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/cirq-latest-latest.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/cirq-latest-latest.yml) | 19 | | [Qulacs](https://github.com/PennyLaneAI/pennylane-qulacs) | ![](https://img.shields.io/pypi/v/pennylane-qulacs?color=green&label=%20&style=flat-square) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/qulacs-stable-stable.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/qulacs-stable-stable.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/qulacs-stable-latest.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/qulacs-stable-latest.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/qulacs-latest-stable.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/qulacs-latest-stable.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/qulacs-latest-latest.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/qulacs-latest-latest.yml) | 20 | | [AQT](https://github.com/PennyLaneAI/pennylane-aqt) | ![](https://img.shields.io/pypi/v/pennylane-aqt?color=green&label=%20&style=flat-square) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/aqt-stable-stable.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/aqt-stable-stable.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/aqt-stable-latest.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/aqt-stable-latest.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/aqt-latest-stable.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/aqt-latest-stable.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/aqt-latest-latest.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/aqt-latest-latest.yml) | 21 | | [IonQ](https://github.com/PennyLaneAI/pennylane-ionq) | ![](https://img.shields.io/pypi/v/pennylane-ionq?color=green&label=%20&style=flat-square) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/ionq-stable-stable.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/ionq-stable-stable.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/ionq-stable-latest.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/ionq-stable-latest.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/ionq-latest-stable.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/ionq-latest-stable.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/ionq-latest-latest.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/ionq-latest-latest.yml) | 22 | | [Lightning](https://github.com/PennyLaneAI/pennylane-lightning) | ![](https://img.shields.io/pypi/v/pennylane-lightning?color=green&label=%20&style=flat-square) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/pennylane-lightning/compat-check-stable-stable.yml?branch=master)](https://github.com/PennyLaneAI/pennylane-lightning/actions/workflows/compat-check-stable-stable.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/pennylane-lightning/compat-check-stable-latest.yml?branch=master)](https://github.com/PennyLaneAI/pennylane-lightning/actions/workflows/compat-check-stable-latest.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/pennylane-lightning/compat-check-latest-stable.yml?branch=master)](https://github.com/PennyLaneAI/pennylane-lightning/actions/workflows/compat-check-latest-stable.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/pennylane-lightning/compat-check-latest-latest.yml?branch=master)](https://github.com/PennyLaneAI/pennylane-lightning/actions/workflows/compat-check-latest-latest.yml) | 23 | | [Braket](https://github.com/aws/amazon-braket-pennylane-plugin-python) | ![](https://img.shields.io/pypi/v/amazon-braket-pennylane-plugin?color=green&label=%20&style=flat-square) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/braket-stable-stable.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/braket-stable-stable.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/braket-stable-latest.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/braket-stable-latest.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/braket-latest-stable.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/braket-latest-stable.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/braket-latest-latest.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/braket-latest-latest.yml) | 24 | 25 | 26 | *Notes:* 27 | 28 | * The device integration tests currently do not support devices with a fixed 29 | number of wires. 30 | 31 | * The Braket plugin device integration tests are run with `-k “not Sample and not no_0_shots”`, 32 | see #6 33 | 34 | * The Qiskit tests are run using local simulators. There are no tests that access the IBM Quantum backends. 35 | 36 | 37 | ## QML repo 38 | 39 | | | Status | 40 | | :---------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 41 | | [`build-branch-dev`](https://github.com/PennyLaneAI/qml/blob/master/.github/workflows/build-branch-dev.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/qml/build-branch-dev.yml)](https://github.com/PennyLaneAI/qml/actions/workflows/build-branch-dev.yml) | 42 | | [`build-branch-master`](https://github.com/PennyLaneAI/qml/blob/master/.github/workflows/build-branch-master.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/qml/build-branch-master.yml)](https://github.com/PennyLaneAI/qml/actions/workflows/build-branch-master.yml) | 43 | | [`update-dev`](https://github.com/PennyLaneAI/qml/blob/master/.github/workflows/update-dev.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/qml/update-dev.yml)](https://github.com/PennyLaneAI/qml/actions/workflows/update-dev.yml) | 44 | 45 | ## Lightning Docker builds 46 | 47 | | | Status | 48 | | :--------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 49 | | [Docker build `stable`](https://github.com/PennyLaneAI/pennylane-lightning/blob/master/.github/workflows/compat-docker-stable.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/pennylane-lightning/compat-docker-stable.yml?branch=master)](https://github.com/PennyLaneAI/pennylane-lightning/actions/workflows/compat-docker-stable.yml) | 50 | | [Docker build `latest`](https://github.com/PennyLaneAI/pennylane-lightning/blob/master/.github/workflows/compat-docker-latest.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/pennylane-lightning/compat-docker-latest.yml?branch=master)](https://github.com/PennyLaneAI/pennylane-lightning/actions/workflows/compat-docker-latest.yml) | 51 | 52 | ## Catalyst compiler 53 | 54 | The following table shows the current Catalyst compatibility with the Lightning and PennyLane packages, where each of the 3 packages is tested as "latest" and "stable". Latest versions are built directly from the repository's main or master branch, while stable is built from the repository at the most recent release tag. The reason this is needed rather than installing PyPI packages is that the Lightning dependency in Catalyst needs to be built from source and cannot be obtained from the PyPI package. PennyLane stable is installed from PyPI. 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 |
PennyLane stablePennyLane latest
Lightning stableLightning latestLightning stableLightning latest
Catalyst stableCheck CPL stable/stable/stableCheck CPL stable/stable/latestCheck CPL stable/latest/stableCheck CPL stable/latest/latest
Catalyst latestCheck CPL latest/stable/stableCheck CPL latest/stable/latestCheck CPL latest/latest/stableCheck CPL latest/latest/latest
84 | 85 | ## Latest reported warnings 86 | 87 | ### PennyLane 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 |
UserWarning
DeprecationWarning
pytest.PytestRemovedIn9Warning
PendingDeprecationWarning
pytest.PytestUnraisableExceptionWarning
numpy.exceptions.ComplexWarning
RuntimeWarning
pytest.PytestCollectionWarning
FutureWarning
pennylane.PennyLaneDeprecationWarning
131 | 132 | 133 | ## Interpreting the test matrix 134 | 135 | * **Stable/stable**: This reflects a scenario where PennyLane and the plugin are both installed 136 | from PyPI. This column should **always** pass. If this test fails, it indicates that either (a) a 137 | bug exists, or (b) an upstream dependency (such as Qiskit or Qulacs) 138 | were released with breaking changes. In both cases, a bugfix release of the plugin should be made. 139 | 140 | * **Stable/latest passing**: A new plugin release is not essential; the current 141 | PyPI release will continue to work once the new PennyLane version is released. 142 | 143 | - **Latest/latest passing**: Nothing to be done! However, it is still worth checking the 144 | plugin repository to see if new unreleased changes have been added that would 145 | be worth releasing. 146 | 147 | - **Latest/latest failing**: Indicates that recent changes have been made to the plugin repository 148 | post-release; further updates must be made to the plugin to ensure GitHub master passes. 149 | 150 | * **Stable/latest failing**: A new plugin release is required for compatibility 151 | with the upcoming PennyLane release. 152 | 153 | - **Latest/latest failing**: Updates must be made to the plugin to ensure GitHub 154 | master passes. 155 | 156 | - **Latest/stable failing**: The requirement of PennyLane in the plugin will 157 | have to be increased. 158 | 159 | - **Latest/latest passing**: Nothing to be done! The plugin is ready to be released 160 | with the upcoming PennyLane release. 161 | 162 | ## Feature freeze testing matrix 163 | 164 | The latest of all plugins are tested against the PennyLane release candidate branch (GitHub `vX.XX.X-rc0` branch). 165 | 166 | | | Status | 167 | | :-------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 168 | | [Qiskit](https://github.com/PennyLaneAI/pennylane-qiskit) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/qiskit-latest-rc.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/qiskit-latest-rc.yml) | 169 | | [Cirq](https://github.com/PennyLaneAI/pennylane-cirq) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/cirq-latest-rc.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/cirq-latest-rc.yml) | 170 | | [Qulacs](https://github.com/PennyLaneAI/pennylane-qulacs) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/qulacs-latest-rc.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/qulacs-latest-rc.yml) | 171 | | [AQT](https://github.com/PennyLaneAI/pennylane-aqt) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/aqt-latest-rc.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/aqt-latest-rc.yml) | 172 | | [IonQ](https://github.com/PennyLaneAI/pennylane-ionq) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/ionq-latest-rc.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/ionq-latest-rc.yml) | 173 | | [Braket](https://github.com/aws/amazon-braket-pennylane-plugin-python) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/braket-latest-rc.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/braket-latest-rc.yml) | 174 | 175 | The latest and release candidate of Lightning and Catalyst are tested with the release candidate of PennyLane: 176 | 177 | | | Latest | Release candidate | 178 | | :------------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 179 | | [Lightning](https://github.com/PennyLaneAI/pennylane-lightning) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/plugin-test-matrix/lightning-latest-rc.yml?branch=master)](https://github.com/PennyLaneAI/plugin-test-matrix/actions/workflows/lightning-latest-rc.yml) | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/pennylane-lightning/compat-check-release-release.yml?branch=master)](https://github.com/PennyLaneAI/pennylane-lightning/actions/workflows/compat-check-release-release.yml) | 180 | | [Catalyst](https://github.com/PennyLaneAI/catalyst) | | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/catalyst/CPL_rc-rc-rc.yaml)](https://github.com/PennyLaneAI/catalyst/actions/workflows/CPL_rc-rc-rc.yaml) | 181 | | [Docker build](https://github.com/PennyLaneAI/pennylane-lightning/tree/master/docker) | | [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PennyLaneAI/pennylane-lightning/compat-docker-release.yml?branch=master)](https://github.com/PennyLaneAI/pennylane-lightning/actions/workflows/compat-docker-release.yml) | 182 | 183 | 184 | ## Adding a plugin 185 | 186 | Two Jinja2 workflow templates are provided, that makes it easier to add a new plugin to the test matrix: 187 | 188 | * [`workflow-template-latest.yml`](workflow-template-latest.yml): for testing plugins against PennyLane latest 189 | * [`workflow-template-stable.yml`](workflow-template-stable.yml): for testing plugins against PennyLane stable 190 | 191 | Simply add a new plugin to the `workflows` list in [`compile.py`](compile.py), with the following dictionary keys: 192 | 193 | * `plugin` (required): the name of the plugin **not including the PennyLane prefix**. The plugin 194 | repository and PyPI project are inferred from the plugin name. E.g., `'plugin': 'qiskit'` will 195 | correspond to the GitHub repo PennyLaneAI/pennylane-qiskit and the PyPI project 196 | `pennylane-qiskit`. 197 | 198 | * `gh_user` (required): the GitHub user or organization which hosts the plugin repository. 199 | 200 | * `which` (required): a set specifying whether to generate a workflow to test the `{"latest"}` 201 | (GitHub master) version of the plugin, `{"stable"}` (PyPI) version of the plugin, or both `{"latest", "stable"}`. 202 | 203 | * `requirements` (optional): a list of Python packages that should be installed prior to plugin 204 | installation. You may use `pip` syntax, e.g., `pyscf==1.7.2`. 205 | 206 | * `requirements_latest` (optional): *additional* list of Python packages that should be installed prior to 207 | latest/GitHub master plugin installation. For example, if the latest version of the plugin depends on a 208 | development version of a particular framework. 209 | 210 | * `device_tests` (optional): a list of command line arguments to pass to the PennyLane device 211 | integration tests. Each list element corresponds to a single test run, e.g., 212 | 213 | ```python 214 | "device_tests": 215 | [ 216 | "--device=cirq.simulator --tb=short --skip-ops --analytic=True", 217 | "--device=cirq.simulator --tb=short --skip-ops --analytic=False --shots=8000" 218 | ] 219 | ``` 220 | 221 | * `additional_setup` (optional): multiline string containing additional GitHub actions for execution 222 | before the installment of plugins. 223 | 224 | * `token` (optional): sets an environment variable with the same name as the token. The value is loaded from the 225 | repository secrets. The token is required by some plugins for backend authentication. 226 | 227 | * `additional_env_vars` (optional): string containing additional environment variables you'd like to be set for 228 | the CI action. Double-check the whitespace when using this - variables should be separated with "\n " 229 | 230 | * `runs_on` (optional): string to override the workflow's default `runs-on` attribute of `ubuntu-latest`. 231 | 232 | * `test_kwargs` (optional): additional arguments to pass to pytest for the given plugin. 233 | 234 | * `no_deprecation_error` (optional): set to True to not raise PL deprecation warnings as errors when testing 235 | the latest version of the plugin. By default, PL deprecation warnings are raised as errors. 236 | 237 | Once you have added your plugin, run 238 | 239 | ```console 240 | $ python compile.py 241 | ``` 242 | 243 | This will autogenerate up to five workflow files, depending on the variable `which`: 244 | 245 | * `.github/workflows/plugin-stable-stable.yml` 246 | * `.github/workflows/plugin-stable-latest.yml` 247 | * `.github/workflows/plugin-latest-stable.yml` 248 | * `.github/workflows/plugin-latest-latest.yml` 249 | * `.github/workflows/plugin-latest-rc.yml` 250 | 251 | Finally, make sure to add a row to the testing matrix above! 252 | -------------------------------------------------------------------------------- /compile.py: -------------------------------------------------------------------------------- 1 | from textwrap import dedent 2 | 3 | from jinja2 import FileSystemLoader, Environment 4 | 5 | 6 | workflows = [ 7 | { 8 | "plugin": "qiskit", 9 | "gh_user": "PennyLaneAI", 10 | "which": ["latest", "stable"], 11 | "requirements": ["qiskit", "pyscf"], 12 | "device_tests": [ 13 | "--device=qiskit.basicsim --tb=short --skip-ops --shots=20000 --device-kwargs backend=basic_simulator", 14 | "--device=qiskit.aer --tb=short --skip-ops --shots=20000", 15 | "--device=qiskit.aer --tb=short --skip-ops --shots=None --device-kwargs backend=statevector_simulator", 16 | "--device=qiskit.aer --tb=short --skip-ops --shots=None --device-kwargs backend=unitary_simulator", 17 | ], 18 | "token": "IBMQX_TOKEN", 19 | }, 20 | { 21 | "plugin": "cirq", 22 | "gh_user": "PennyLaneAI", 23 | "which": ["latest", "stable"], 24 | "requirements": ["cirq", "qsimcirq"], 25 | "device_tests": [ 26 | "--device=cirq.simulator --tb=short --skip-ops --shots=None", 27 | "--device=cirq.simulator --tb=short --skip-ops --shots=20000", 28 | "--device=cirq.mixedsimulator --tb=short --skip-ops --shots=None", 29 | "--device=cirq.mixedsimulator --tb=short --skip-ops --shots=20000", 30 | "--device=cirq.pasqal --tb=short --skip-ops --analytic=False --shots=20000 --device-kwargs control_radius=2.", 31 | "--device=cirq.qsim --tb=short --skip-ops --analytic=False --shots=20000", 32 | ], 33 | }, 34 | { 35 | "plugin": "qulacs", 36 | "gh_user": "PennyLaneAI", 37 | "which": ["stable", "latest"], 38 | "requirements": ["qulacs"], 39 | "device_tests": [ 40 | "--device=qulacs.simulator --tb=short --skip-ops --shots=None", 41 | "--device=qulacs.simulator --tb=short --skip-ops --shots=20000", 42 | ], 43 | }, 44 | { 45 | "plugin": "aqt", 46 | "gh_user": "PennyLaneAI", 47 | "which": ["stable", "latest"], 48 | "requirements": [], 49 | "device_tests": [], 50 | }, 51 | { 52 | "plugin": "ionq", 53 | "gh_user": "PennyLaneAI", 54 | "which": ["stable", "latest"], 55 | "requirements": [], 56 | "device_tests": ["--device=ionq.simulator --tb=short --skip-ops --shots=10000"], 57 | "token": "IONQ_API_KEY", 58 | }, 59 | { 60 | "plugin": "braket", 61 | "plugin_repo": "amazon-braket-pennylane-plugin-python", 62 | "plugin_package": "amazon-braket-pennylane-plugin", 63 | "gh_user": "aws", 64 | "which": ["stable", "latest"], 65 | "requirements": ["pytest-xdist"], 66 | "device_tests": [], 67 | "branch": "main", 68 | "device_tests": [ 69 | "--device=braket.local.qubit --tb=short --skip-ops --shots=20000 -k 'not no_0_shots'", 70 | "--device=braket.local.qubit --tb=short --skip-ops -k 'not Sample and not no_0_shots'", 71 | ], 72 | "tests_loc": "test/unit_tests", 73 | "additional_setup": dedent(""" 74 | - name: Install TF 75 | run: | 76 | pip install tensorflow~=$TF_VERSION keras~=$TF_VERSION 77 | 78 | - name: Install JAX 79 | run: | 80 | pip install jax==$JAX_VERSION jaxlib==$JAX_VERSION""" 81 | 82 | ), 83 | "additional_env_vars": "TF_VERSION: 2.12.0\n TORCH_VERSION: 2.0.0+cpu\n JAX_VERSION: 0.4.28", 84 | "no_deprecation_error": True, 85 | }, 86 | ] 87 | 88 | 89 | def render_from_template(template, **kwargs): 90 | loader = FileSystemLoader(".") 91 | env = Environment(loader=loader) 92 | template = env.get_template(template) 93 | return template.render(**kwargs) 94 | 95 | 96 | def render_templates(): 97 | 98 | for wf in workflows: 99 | 100 | if "plugin_package" not in wf: 101 | plugin_name = wf["plugin"] 102 | wf["plugin_package"] = "pennylane_" + plugin_name 103 | 104 | if "plugin_repo" not in wf: 105 | plugin_name = wf["plugin"] 106 | wf["plugin_repo"] = "pennylane-" + plugin_name 107 | 108 | if "tests_loc" not in wf: 109 | wf["tests_loc"] = "tests" 110 | 111 | # PennyLane stable tests 112 | for i in wf["which"]: 113 | with open(f".github/workflows/{wf['plugin']}-{i}-stable.yml", "w") as f: 114 | f.write(render_from_template("workflow-template-stable.yml", latest=i == "latest", **wf)) 115 | 116 | # PennyLane latest tests 117 | for i in wf["which"]: 118 | with open(f".github/workflows/{wf['plugin']}-{i}-latest.yml", "w") as f: 119 | f.write( 120 | render_from_template("workflow-template-latest.yml", latest=i == "latest", **wf) 121 | ) 122 | 123 | # PennyLane release candidate tests 124 | with open(f".github/workflows/{wf['plugin']}-latest-rc.yml", "w") as f: 125 | f.write( 126 | render_from_template("workflow-template-release-candidate.yml", latest=True, **wf) 127 | ) 128 | 129 | 130 | if __name__ == "__main__": 131 | render_templates() 132 | -------------------------------------------------------------------------------- /workflow-template-latest.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane latest 2 | 3 | name: {{ plugin }}-{% if latest %}latest{% else %}stable{% endif %}-latest 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: {{ gh_user }}/{{ plugin_repo }} 16 | PLUGIN_BRANCH: {% if branch %}{{ branch }}{% else %}master{% endif %} 17 | PLUGIN_PACKAGE: {{ plugin_package }} 18 | PENNYLANE_BRANCH: master 19 | {%- if token is defined %} 20 | {{ token }}: {% raw %}${{ secrets.{% endraw %}{{ token }}{% raw %} }}{% endraw %} 21 | {%- endif %} 22 | {%- if additional_env_vars is defined %} 23 | {{ additional_env_vars }} 24 | {%- endif %} 25 | 26 | 27 | jobs: 28 | tests: 29 | runs-on: {% if runs_on is defined %}{{ runs_on }}{% else %}ubuntu-latest{% endif %} 30 | 31 | strategy: 32 | fail-fast: false 33 | 34 | steps: 35 | - name: Cancel Previous Runs 36 | uses: styfle/cancel-workflow-action@0.4.1 37 | with: 38 | access_token: {% raw %}${{ github.token }}{% endraw %} 39 | 40 | - name: Set up Python 41 | uses: actions/setup-python@v2 42 | with: 43 | python-version: "3.10" 44 | 45 | {%- if additional_setup is defined %} 46 | {{ additional_setup | indent(6, True) }} 47 | {%- endif %} 48 | 49 | - name: Install requirements 50 | run: | 51 | pip install --upgrade pip 52 | {%- for req in requirements %} 53 | pip install --upgrade {{ req }} 54 | {%- endfor %} 55 | {%- if requirements_latest is defined %} 56 | {%- for req in requirements_latest %} 57 | pip install --upgrade {{ req }} 58 | {%- endfor %} 59 | {%- endif %} 60 | pip install 'pytest<8.1.0' 61 | pip install pytest-mock pytest-cov flaky pytest-benchmark 62 | pip freeze 63 | 64 | {%- if latest %} 65 | 66 | - name: Install PennyLane and Plugin 67 | run: | 68 | {% raw -%} 69 | pip install git+https://github.com/PennyLaneAI/pennylane.git \ 70 | git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }} 71 | {%- endraw %} 72 | 73 | - uses: actions/checkout@v2 74 | with: 75 | repository: {% raw %}${{ env.PLUGIN_REPO }}{% endraw %} 76 | path: plugin_repo 77 | ref: {% raw %}${{ env.PLUGIN_BRANCH }}{% endraw %} 78 | 79 | {% else %} 80 | 81 | - name: Install PennyLane and Plugin 82 | run: | 83 | {% raw -%} 84 | pip install git+https://github.com/PennyLaneAI/pennylane.git \ 85 | ${{ env.PLUGIN_PACKAGE }} --upgrade 86 | {%- endraw %} 87 | 88 | - name: Get plugin version 89 | id: plugin-version 90 | run: | 91 | {% raw -%} 92 | PLUGIN_VERSION=$(python -c "import pkg_resources as pkg; print(pkg.get_distribution('${{ env.PLUGIN_PACKAGE }}').version)") 93 | echo "version=$PLUGIN_VERSION" >> $GITHUB_OUTPUT 94 | {%- endraw %} 95 | 96 | - uses: actions/checkout@v2 97 | with: 98 | repository: {% raw %}${{ env.PLUGIN_REPO }}{% endraw %} 99 | path: plugin_repo 100 | ref: {% raw %}v${{ steps.plugin-version.outputs.version }}{% endraw %} 101 | 102 | {% endif -%} 103 | 104 | - name: Run PennyLane device integration tests 105 | run: | 106 | {%- for test in device_tests %} 107 | pl-device-test {{ test }} 108 | {%- endfor %} 109 | 110 | - name: Run plugin tests 111 | run: | 112 | python -m pytest plugin_repo/{{ tests_loc }} --tb=short {%- for kwarg in test_kwargs %} {{ kwarg }}{%- endfor %}{% if no_deprecation_error %}{% else %} \ 113 | -W "error::pennylane.PennyLaneDeprecationWarning"{% endif %} 114 | 115 | -------------------------------------------------------------------------------- /workflow-template-release-candidate.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane release candidate 2 | 3 | name: {{ plugin }}-latest-rc 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: {{ gh_user }}/{{ plugin_repo }} 16 | PLUGIN_BRANCH: {% if branch %}{{ branch }}{% else %}master{% endif %} 17 | PLUGIN_PACKAGE: {{ plugin_package }} 18 | PENNYLANE_BRANCH: master 19 | {%- if token is defined %} 20 | {{ token }}: {% raw %}${{ secrets.{% endraw %}{{ token }}{% raw %} }}{% endraw %} 21 | {%- endif %} 22 | {%- if additional_env_vars is defined %} 23 | {{ additional_env_vars }} 24 | {%- endif %} 25 | 26 | 27 | jobs: 28 | tests: 29 | runs-on: {% if runs_on is defined %}{{ runs_on }}{% else %}ubuntu-latest{% endif %} 30 | 31 | strategy: 32 | fail-fast: false 33 | 34 | steps: 35 | - name: Cancel Previous Runs 36 | uses: styfle/cancel-workflow-action@0.4.1 37 | with: 38 | access_token: {% raw %}${{ github.token }}{% endraw %} 39 | 40 | - name: Set up Python 41 | uses: actions/setup-python@v2 42 | with: 43 | python-version: "3.10" 44 | 45 | {%- if additional_setup is defined %} 46 | {{ additional_setup | indent(6, True) }} 47 | {%- endif %} 48 | 49 | - name: Install requirements 50 | run: | 51 | pip install --upgrade pip 52 | {%- for req in requirements %} 53 | pip install --upgrade {{ req }} 54 | {%- endfor %} 55 | {%- if requirements_latest is defined %} 56 | {%- for req in requirements_latest %} 57 | pip install --upgrade {{ req }} 58 | {%- endfor %} 59 | {%- endif %} 60 | pip install 'pytest<8.1.0' 61 | pip install pytest-mock pytest-cov flaky pytest-benchmark 62 | pip freeze 63 | 64 | - name: Install PennyLane and Plugin 65 | run: | 66 | {% raw -%} 67 | pip install git+https://github.com/PennyLaneAI/pennylane.git@v0.41.0-rc0 \ 68 | git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }} 69 | {%- endraw %} 70 | 71 | - uses: actions/checkout@v2 72 | with: 73 | repository: {% raw %}${{ env.PLUGIN_REPO }}{% endraw %} 74 | path: plugin_repo 75 | ref: {% raw %}${{ env.PLUGIN_BRANCH }}{% endraw %} 76 | 77 | - name: Run PennyLane device integration tests 78 | run: | 79 | {%- for test in device_tests %} 80 | pl-device-test {{ test }} 81 | {%- endfor %} 82 | 83 | - name: Run plugin tests 84 | run: python -m pytest plugin_repo/{{ tests_loc }} --tb=short {%- for kwarg in test_kwargs %} {{ kwarg }} {%- endfor %} 85 | 86 | -------------------------------------------------------------------------------- /workflow-template-stable.yml: -------------------------------------------------------------------------------- 1 | # Workflow template for testing plugins against PennyLane stable 2 | 3 | name: {{ plugin }}-{% if latest %}latest{% else %}stable{% endif %}-stable 4 | on: 5 | push: 6 | branches: 7 | - master 8 | pull_request: 9 | schedule: 10 | - cron: '0 0 * * 0' 11 | workflow_dispatch: 12 | 13 | 14 | env: 15 | PLUGIN_REPO: {{ gh_user }}/{{ plugin_repo }} 16 | PLUGIN_BRANCH: {% if branch %}{{ branch }}{% else %}master{% endif %} 17 | PLUGIN_PACKAGE: {{ plugin_package }} 18 | PENNYLANE_BRANCH: master 19 | {%- if token is defined %} 20 | {{ token }}: {% raw %}${{ secrets.{% endraw %}{{ token }}{% raw %} }}{% endraw %} 21 | {%- endif %} 22 | {%- if additional_env_vars is defined %} 23 | {{ additional_env_vars }} 24 | {%- endif %} 25 | 26 | 27 | jobs: 28 | tests: 29 | runs-on: {% if runs_on is defined %}{{ runs_on }}{% else %}ubuntu-latest{% endif %} 30 | 31 | strategy: 32 | fail-fast: false 33 | 34 | steps: 35 | - name: Cancel Previous Runs 36 | uses: styfle/cancel-workflow-action@0.4.1 37 | with: 38 | access_token: {% raw %}${{ github.token }}{% endraw %} 39 | 40 | - name: Set up Python 41 | uses: actions/setup-python@v2 42 | with: 43 | python-version: "3.10" 44 | 45 | {%- if additional_setup is defined %} 46 | {{ additional_setup | indent(6, True) }} 47 | {%- endif %} 48 | 49 | - name: Install requirements 50 | run: | 51 | pip install --upgrade pip 52 | {%- for req in requirements %} 53 | pip install --upgrade {{ req }} 54 | {%- endfor %} 55 | pip install 'pytest<8.1.0' 56 | pip install pytest-mock pytest-cov flaky pytest-benchmark 57 | pip freeze 58 | 59 | {%- if latest %} 60 | 61 | - name: Install PennyLane and Plugin 62 | run: | 63 | {% raw -%} 64 | pip install pennylane git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }} 65 | {%- endraw %} 66 | 67 | - uses: actions/checkout@v2 68 | with: 69 | repository: {% raw %}${{ env.PLUGIN_REPO }}{% endraw %} 70 | path: plugin_repo 71 | ref: {% raw %}${{ env.PLUGIN_BRANCH }}{% endraw %} 72 | {% else %} 73 | 74 | - name: Install PennyLane and Plugin 75 | run: | 76 | {% raw -%} 77 | pip install pennylane ${{ env.PLUGIN_PACKAGE }} --upgrade 78 | {%- endraw %} 79 | pip freeze 80 | 81 | - name: Get plugin version 82 | id: plugin-version 83 | run: | 84 | {% raw -%} 85 | PLUGIN_VERSION=$(python -c "import pkg_resources as pkg; print(pkg.get_distribution('${{ env.PLUGIN_PACKAGE }}').version)") 86 | echo "version=$PLUGIN_VERSION" >> $GITHUB_OUTPUT 87 | {%- endraw %} 88 | 89 | - uses: actions/checkout@v2 90 | with: 91 | repository: {% raw %}${{ env.PLUGIN_REPO }}{% endraw %} 92 | path: plugin_repo 93 | ref: {% raw %}v${{ steps.plugin-version.outputs.version }}{% endraw %} 94 | {% endif -%} 95 | 96 | {% if device_tests -%} 97 | - name: Run PennyLane device integration tests 98 | run: | 99 | if ! [ -x "$(command -v pl-device-test)" ]; then 100 | echo 'Error: Version of PennyLane does not provide device integration tests.' >&2 101 | else 102 | {%- for test in device_tests %} 103 | pl-device-test {{ test }} 104 | {%- endfor %} 105 | fi 106 | {%- endif %} 107 | 108 | - name: Run plugin tests 109 | run: python -m pytest plugin_repo/{{ tests_loc }} --tb=short {%- for kwarg in test_kwargs %} {{ kwarg }} {%- endfor %} 110 | 111 | --------------------------------------------------------------------------------