Skip to content

Commit

Permalink
Merge branch 'master' into devSXgate
Browse files Browse the repository at this point in the history
  • Loading branch information
LuisAlfredoNu authored Jan 20, 2025
2 parents 10614e8 + 290c986 commit c179a8a
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 20 deletions.
10 changes: 8 additions & 2 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,27 @@

### Improvements

* Update `qml.MultiControlledX` tests following the latest updates in PennyLane.
[(#1040)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1040)

* Update the minimum required version of PennyLane to `v0.40.0`.
[(#1033)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1033)

* Merge the `v0.40.0-rc` branch to the master and bump version.
[(#1038)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1038)

### Documentation

### Bug fixes

* Update Github CI to use Ubuntu 24 and remove `libopenblas-base` package.
[(#1041)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1041)

### Contributors

This release contains contributions from (in alphabetical order):

Joseph Lee, Shuli Shu
Yushao Chen, Joseph Lee, Shuli Shu

---

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/tests_linux_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ env:
TF_VERSION: 2.10.0
TORCH_VERSION: 1.11.0+cpu
COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --no-flaky-report -p no:warnings --tb=native"
GCC_VERSION: 11
GCC_VERSION: 13
OMP_NUM_THREADS: "2"
OMP_PROC_BIND: "false"

Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
cd ./Build
mkdir -p ./tests/results
for file in *runner ; do ./$file --order lex --reporter junit --out ./tests/results/report_$file.xml; done;
lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info
lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info --ignore-errors mismatch # Catch2 causes mismatch errors that needs to be ignored
lcov --remove coverage.info '/usr/*' --output-file coverage.info
mv coverage.info coverage-${{ github.job }}-${{ matrix.pl_backend }}-${{ matrix.enable_kernel_avx_streaming }}-${{ matrix.enable_kernel_omp }}.info
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:

- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION libopenblas-base libopenblas-dev ninja-build gcovr lcov
sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION libopenblas-dev ninja-build gcovr lcov
python -m pip install scipy-openblas32
- name: Build and run unit tests
Expand All @@ -146,7 +146,7 @@ jobs:
cd ./Build
mkdir -p ./tests/results
for file in *runner ; do ./$file --order lex --reporter junit --out ./tests/results/report_$file.xml; done;
lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info
lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info --ignore-errors mismatch # Catch2 causes mismatch errors that needs to be ignored
lcov --remove coverage.info '/usr/*' --output-file coverage.info
mv coverage.info coverage-${{ github.job }}-${{ matrix.pl_backend }}.info
Expand Down Expand Up @@ -174,14 +174,14 @@ jobs:
uses: ./.github/workflows/build_and_cache_Kokkos_linux.yml
with:
runs_on: pl-4-core-large-runner
os: ubuntu-22.04
os: ubuntu-latest

cpptestswithKokkos:
if: ${{ !contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) }}
needs: [build_and_cache_Kokkos]
strategy:
matrix:
os: [ubuntu-22.04]
os: [ubuntu-latest]
pl_backend: ["lightning_kokkos"]
exec_model: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.exec_model) }}
kokkos_version: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.kokkos_version) }}
Expand Down Expand Up @@ -232,7 +232,7 @@ jobs:
cd ./Build
mkdir -p ./tests/results-${{ github.job }}-${{ matrix.pl_backend }}
for file in *runner ; do ./$file --order lex --reporter junit --out ./tests/results-${{ github.job }}-${{ matrix.pl_backend }}/report_$file.xml; done;
lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info
lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info --ignore-errors mismatch # Catch2 causes mismatch errors that needs to be ignored
lcov --remove coverage.info '/usr/*' --output-file coverage.info
mv coverage.info coverage-${{ github.job }}-${{ matrix.pl_backend }}.info
Expand Down Expand Up @@ -282,7 +282,7 @@ jobs:
needs: [build_and_cache_Kokkos]
strategy:
matrix:
os: [ubuntu-22.04]
os: [ubuntu-latest]
exec_model: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.exec_model) }}
kokkos_version: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.kokkos_version) }}
timeout-minutes: 60
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests_lkcpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ jobs:
name: "Build and cache Kokkos"
uses: ./.github/workflows/build_and_cache_Kokkos_linux.yml
with:
os: ubuntu-22.04
os: ubuntu-latest
kokkos_version: "4.5.00"

build_lightning_kokkos_wheels:
needs: [build_and_cache_Kokkos]
strategy:
matrix:
os: [ubuntu-22.04]
os: [ubuntu-latest]
pl_backend: ["lightning_kokkos"]
exec_model: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.exec_model) }}
kokkos_version: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.kokkos_version) }}
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:
needs: [build_and_cache_Kokkos, build_lightning_kokkos_wheels]
strategy:
matrix:
os: [ubuntu-22.04]
os: [ubuntu-latest]
pl_backend: ["lightning_kokkos"]
group: [1, 2, 3, 4, 5, 6, 7]
exec_model: ${{ fromJson(needs.build_and_cache_Kokkos.outputs.exec_model) }}
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/tests_lqcpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ env:
TF_VERSION: 2.10.0
TORCH_VERSION: 1.11.0+cpu
COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --no-flaky-report -p no:warnings --tb=native"
GCC_VERSION: 11
GCC_VERSION: 13
OMP_NUM_THREADS: "2"
OMP_PROC_BIND: "false"

Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION libopenblas-base libopenblas-dev
sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION libopenblas-dev
python -m pip install scipy-openblas32 wheel
- name: Get required Python packages
Expand Down Expand Up @@ -144,6 +144,10 @@ jobs:
name: wheel_${{ matrix.pl_backend }}-${{ matrix.blas }}.whl
path: ${{ github.workspace }}

- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get -y -q install libopenblas-dev
- name: Get required Python packages
run: |
WHEEL_NAME=$(cat ${{ github.workspace }}/${{ matrix.pl_backend }}-${{ matrix.blas }}_name.txt)
Expand Down
12 changes: 10 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ PennyLane-Lightning high performance simulators include the following backends:
* ``lightning.kokkos``: a state-vector simulator written with `Kokkos <https://kokkos.github.io/kokkos-core-wiki/index.html>`_. It can exploit the inherent parallelism of modern processing units supporting the `OpenMP <https://www.openmp.org/>`_, `CUDA <https://developer.nvidia.com/cuda-toolkit>`_ or `HIP <https://rocm.docs.amd.com/projects/HIP/en/latest/>`_ programming models.
* ``lightning.tensor``: a tensor network simulator based on the `NVIDIA cuQuantum SDK <https://developer.nvidia.com/cuquantum-sdk>`_. The supported methods are Matrix Product State (MPS) and Exact Tensor Network (TN).

If you're not sure what simulator to use, check out our `PennyLane performance <https://pennylane.ai/performance>`_ page.

.. header-end-inclusion-marker-do-not-remove
The following table summarizes the supported platforms and the primary installation mode:
Expand Down Expand Up @@ -218,7 +220,13 @@ Install Lightning-GPU from source

The section below contains instructions for installing Lightning-GPU **from source**. For most cases, *this is not required* and one can simply use the installation instructions at `pennylane.ai/install <https://pennylane.ai/install/#high-performance-computing-and-gpus>`__. If those instructions do not work for you, or you have a more complex build environment that requires building from source, then consider reading on.

To install Lightning-GPU from source, Lightning-Qubit needs to be 'installed' by ``pip`` before Lightning-GPU (compilation is not necessary):
Since you will be installing PennyLane-Lightning from the master branch, it is recommended to install PennyLane from master:

.. code-block:: bash
pip install git+https://github.com/PennyLaneAI/pennylane.git@master
To install Lightning-GPU from the package sources using the direct SDK path first install Lightning-Qubit (compilation is not necessary):

.. code-block:: bash
Expand All @@ -235,7 +243,7 @@ Note that `custatevec-cu12` is a requirement for Lightning-GPU, and is installed
export CUQUANTUM_SDK=$(python -c "import site; print( f'{site.getsitepackages()[0]}/cuquantum')")
The Lightning-GPU can then be installed with ``pip``:
Lightning-GPU can then be installed with ``pip``:

.. code-block:: bash
Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/core/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
Version number (major.minor.patch[-label])
"""

__version__ = "0.41.0-dev3"
__version__ = "0.41.0-dev5"
2 changes: 1 addition & 1 deletion tests/lightning_tensor/test_gates_and_expval.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def circuit_ansatz(params, wires):
qml.matrix(qml.PauliX([wires[1]])), control_wires=[wires[0]], wires=wires[1]
)
qml.DiagonalQubitUnitary(np.array([1, 1]), wires=wires[2])
qml.MultiControlledX(wires=[wires[0], wires[1], wires[3]], control_values=[wires[0], wires[1]])
qml.MultiControlledX(wires=[wires[0], wires[1], wires[3]], control_values=[0, 1])
qml.PauliX(wires=wires[1])
qml.PauliY(wires=wires[2])
qml.PauliZ(wires=wires[3])
Expand Down
2 changes: 1 addition & 1 deletion tests/test_gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def op(op_name):
"MultiControlledX": [
qml.MultiControlledX,
[],
{"wires": [0, 1, 2], "control_values": "01"},
{"wires": [0, 1, 2], "control_values": [0, 1]},
],
"SingleExcitation": [qml.SingleExcitation, [0.123], {"wires": [0, 1]}],
"SingleExcitationPlus": [qml.SingleExcitationPlus, [0.123], {"wires": [0, 1]}],
Expand Down

0 comments on commit c179a8a

Please sign in to comment.