Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Get site_packages path with pybind11 API in C++ backend #701

Draft
wants to merge 211 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
211 commits
Select commit Hold shift + click to select a range
f18a66e
initial commit
multiphaseCFD Apr 26, 2024
e3b9a22
Auto update version from '0.36.0-dev43' to '0.36.0-dev44'
ringo-but-quantum Apr 26, 2024
9b6e649
check if current implementation works for all
multiphaseCFD Apr 26, 2024
11d2cb3
tidy up
multiphaseCFD Apr 26, 2024
141f4db
test for windows
multiphaseCFD Apr 26, 2024
e91975e
install scipy for lgpu and windows tests
multiphaseCFD Apr 26, 2024
c813e21
runtime check if py_isinitialized()
multiphaseCFD Apr 27, 2024
951e231
add scipy to setup
multiphaseCFD Apr 27, 2024
def8a26
update pybind11
multiphaseCFD Apr 27, 2024
e7815ae
try python import module directly
multiphaseCFD Apr 29, 2024
9872e45
quick fix
multiphaseCFD Apr 29, 2024
25bea68
Merge branch 'master' into pybind11_get_sitepackages
multiphaseCFD May 10, 2024
f2ac6a0
Auto update version from '0.37.0-dev6' to '0.37.0-dev7'
ringo-but-quantum May 10, 2024
26983ca
add pybind11 dependency
multiphaseCFD May 10, 2024
6fd0af4
tidy up code
multiphaseCFD May 10, 2024
24dd8d0
Trigger CI
multiphaseCFD May 10, 2024
1ad1e6d
add changelog
multiphaseCFD May 10, 2024
b91a358
update pybind11
multiphaseCFD May 10, 2024
7863c2a
update python version
multiphaseCFD May 10, 2024
186e423
add pybind11 dependency
multiphaseCFD May 10, 2024
a54aea7
set diferent pyv
multiphaseCFD May 13, 2024
5507f89
Auto update version from '0.37.0-dev7' to '0.37.0-dev9'
ringo-but-quantum May 13, 2024
20019d8
Remove CPhase + Tidy up src (#717)
maliasadi May 10, 2024
972ba59
Update LQ's MCM treatment following dynamic_one_shot update. (#724)
vincentmr May 10, 2024
b314eca
Merge branch 'master' into pybind11_get_sitepackages
multiphaseCFD May 13, 2024
20ffe39
Auto update version from '0.37.0-dev8' to '0.37.0-dev9'
ringo-but-quantum May 13, 2024
034622e
debug
multiphaseCFD May 13, 2024
f3b3a8c
remove python_include_dirs
multiphaseCFD May 13, 2024
dd3bafb
tidy up
multiphaseCFD May 13, 2024
da26b18
Merge branch 'master' into pybind11_get_sitepackages
multiphaseCFD Jul 9, 2024
4befc63
Auto update version from '0.38.0-dev4' to '0.38.0-dev5'
ringo-but-quantum Jul 9, 2024
d6dd285
link against Python libs
multiphaseCFD Jul 10, 2024
c824153
ensure python is always required
multiphaseCFD Jul 10, 2024
a8cdb82
Merge branch 'master' into pybind11_get_sitepackages
multiphaseCFD Jul 10, 2024
d7105e3
Auto update version from '0.38.0-dev5' to '0.38.0-dev6'
ringo-but-quantum Jul 10, 2024
f112dd7
ignore python::python
multiphaseCFD Jul 10, 2024
88ee723
test
multiphaseCFD Jul 10, 2024
2ec98bc
set up venv for macos x86_64
multiphaseCFD Jul 10, 2024
b06e829
quick test
multiphaseCFD Jul 10, 2024
7743561
tidy wheels yml
multiphaseCFD Jul 10, 2024
599d895
Auto update version from '0.38.0-dev6' to '0.38.0-dev7'
ringo-but-quantum Jul 10, 2024
cb3a3da
Remove obsolete commands in CI (post-release fixes) (#792)
vincentmr Jul 10, 2024
6c696e5
Auto update version from '0.38.0-dev6' to '0.38.0-dev7'
ringo-but-quantum Jul 10, 2024
77f1749
Merge branch 'master' into pybind11_get_sitepackages
multiphaseCFD Jul 10, 2024
70fde66
Auto update version from '0.38.0-dev6' to '0.38.0-dev7'
ringo-but-quantum Jul 10, 2024
1d9e273
update cuda wheels
multiphaseCFD Jul 10, 2024
62c4f9c
GCC-12 for wheel linux x86
multiphaseCFD Jul 10, 2024
7a2067c
quick test
multiphaseCFD Jul 10, 2024
8f3f0bb
quick test
multiphaseCFD Jul 10, 2024
a386399
test
multiphaseCFD Jul 10, 2024
3cb927e
quick test
multiphaseCFD Jul 10, 2024
a610bed
add path to python.so to LD_LIBRARY_PATH
multiphaseCFD Jul 10, 2024
40d3351
print out path to libpython*.so
multiphaseCFD Jul 10, 2024
51f4179
get path to python.so
multiphaseCFD Jul 10, 2024
bfe3ecc
get path to PYTHON_LIBRARIES
multiphaseCFD Jul 10, 2024
5106ec9
test
multiphaseCFD Jul 10, 2024
a58f90b
test
multiphaseCFD Jul 10, 2024
e5fc98c
test python_lib_dirs
multiphaseCFD Jul 11, 2024
5a706ef
test
multiphaseCFD Jul 11, 2024
13f85bc
print out Python_LIBRARY_DIRS
multiphaseCFD Jul 11, 2024
699eb4a
install python3-dev
multiphaseCFD Jul 11, 2024
20bc57e
dnf install python3-devel
multiphaseCFD Jul 11, 2024
aec8936
test
multiphaseCFD Jul 11, 2024
2e1760c
add /usr/lib64/ to LD_LIBRARY_PATH
multiphaseCFD Jul 11, 2024
25b3270
get path to scipy.libs from cmake execute_process
multiphaseCFD Jul 11, 2024
6119428
update scipy path for windows
multiphaseCFD Jul 11, 2024
f38c8f2
update workflows
multiphaseCFD Jul 11, 2024
83bc180
install scipy from cmake
multiphaseCFD Jul 11, 2024
f6697ec
quick test
multiphaseCFD Jul 11, 2024
a9bfa0b
test for win32
multiphaseCFD Jul 11, 2024
535bcde
fix for win32
multiphaseCFD Jul 11, 2024
6e3f8f1
update lgpu wheels
multiphaseCFD Jul 11, 2024
92206c7
make format
multiphaseCFD Jul 11, 2024
04c0980
add scipy to win wheels build
multiphaseCFD Jul 11, 2024
ba47c05
update sharedlibloader
multiphaseCFD Jul 11, 2024
24aec42
quick test
multiphaseCFD Jul 11, 2024
b252335
test
multiphaseCFD Jul 11, 2024
c78a948
add mutex
multiphaseCFD Jul 11, 2024
b6ddfce
set -x
multiphaseCFD Jul 11, 2024
5c4a2b7
quick test
multiphaseCFD Jul 11, 2024
bd9b22e
windows-2022->latest
multiphaseCFD Jul 11, 2024
8b36022
[[[[nodiscard]]]]
multiphaseCFD Jul 11, 2024
f353191
link against python_libs
multiphaseCFD Jul 11, 2024
c94b27f
revert to use python interpreter
multiphaseCFD Jul 11, 2024
1c53e7f
update UtilLinearAlg
multiphaseCFD Jul 11, 2024
d2b8dcc
add pybind11 for wheels building
multiphaseCFD Jul 11, 2024
cad0baf
install python-devel
multiphaseCFD Jul 12, 2024
0dda0f8
add pybind11 as a dependency
multiphaseCFD Jul 12, 2024
a2aa536
update cpp tests
multiphaseCFD Jul 12, 2024
6559135
pybind11 required
multiphaseCFD Jul 12, 2024
f09c0d6
fix typo
multiphaseCFD Jul 12, 2024
819875e
remove find_pybind11
multiphaseCFD Jul 12, 2024
d95cc0a
update pybind11 lookup
multiphaseCFD Jul 12, 2024
d882c50
private to interface lightining_util.a
multiphaseCFD Jul 12, 2024
450c443
test linux wheels
multiphaseCFD Jul 12, 2024
3acee42
update
multiphaseCFD Jul 12, 2024
ec9342c
update
multiphaseCFD Jul 12, 2024
42499c6
check if python3
multiphaseCFD Jul 12, 2024
90d3fba
wheels building x86_64
multiphaseCFD Jul 12, 2024
9f0c457
export path/to/python path
multiphaseCFD Jul 12, 2024
297cc0e
debug
multiphaseCFD Jul 12, 2024
d5eea85
debug
multiphaseCFD Jul 12, 2024
33c1e3b
quick fix
multiphaseCFD Jul 12, 2024
278050e
set PYTHON_LIBRARY env
multiphaseCFD Jul 12, 2024
b6402e5
Python_LIBRARY->PYTHON_LIBARAY
multiphaseCFD Jul 12, 2024
e742535
add CMAKE_ARGS
multiphaseCFD Jul 12, 2024
d10d360
test
multiphaseCFD Jul 12, 2024
17a42b5
quick test
multiphaseCFD Jul 12, 2024
79490f8
test
multiphaseCFD Jul 12, 2024
8c92d97
fix typo
multiphaseCFD Jul 12, 2024
e3f2b54
add path to py_exe, py_include_dir, py_lib
multiphaseCFD Jul 12, 2024
e8ba245
Merge branch 'master' into pybind11_get_sitepackages
multiphaseCFD Aug 14, 2024
96182dc
access scipy lib path with scipy module
multiphaseCFD Aug 14, 2024
4df8dd5
Auto update version from '0.38.0-dev33' to '0.38.0-dev34'
ringo-but-quantum Aug 14, 2024
236b563
add BLASLibLoaderManager class
multiphaseCFD Aug 15, 2024
1112ee0
update setup.py and cmake
multiphaseCFD Aug 15, 2024
3826a1a
update wheels CIs
multiphaseCFD Aug 15, 2024
dc4a328
update project.toml
multiphaseCFD Aug 15, 2024
1e051a1
Auto update version from '0.38.0-dev34' to '0.38.0-dev35'
ringo-but-quantum Aug 15, 2024
72c1e71
Merge branch 'master' into pybind11_get_sitepackages
multiphaseCFD Aug 15, 2024
48da2c2
Auto update version from '0.38.0-dev34' to '0.38.0-dev35'
ringo-but-quantum Aug 15, 2024
b0ddeb2
update configure_pyproject_toml
multiphaseCFD Aug 15, 2024
1ad4583
add scipy to requirement
multiphaseCFD Aug 15, 2024
e551ae5
update wheels CIs
multiphaseCFD Aug 15, 2024
572e767
add pybind11 layer + disable python & pybind11 link for python packag…
multiphaseCFD Aug 15, 2024
d249f68
avoid implicit conversion sharedlibloader
multiphaseCFD Aug 15, 2024
1cc5f95
REMOVE CHECK FOR WINDOWS
multiphaseCFD Aug 15, 2024
cf80558
avoid implicit conversion for getprocs
multiphaseCFD Aug 15, 2024
4e9ed1a
add headers
multiphaseCFD Aug 15, 2024
d95ea39
C++ layer changes only
multiphaseCFD Aug 15, 2024
ef90f6f
update linux wheel CI
multiphaseCFD Aug 15, 2024
f89a55e
make format
multiphaseCFD Aug 15, 2024
f0b5786
fix python version
multiphaseCFD Aug 15, 2024
306fac8
add toml
multiphaseCFD Aug 15, 2024
24a151a
further avoid implicit funcptr convert
multiphaseCFD Aug 15, 2024
1484874
remove commonAlignmentHelper
multiphaseCFD Aug 15, 2024
d5d9cf1
add #include <type_traits>
multiphaseCFD Aug 15, 2024
565bc5c
revert changes in CIs
multiphaseCFD Aug 16, 2024
dcb2e79
default lapack tests for catalyst
multiphaseCFD Aug 16, 2024
f60812e
fix tidy complains
multiphaseCFD Aug 16, 2024
555b3f2
tidy up code
multiphaseCFD Aug 16, 2024
b94888c
quick fix for windows wheels
multiphaseCFD Aug 16, 2024
0ce5ca8
windows fix try
multiphaseCFD Aug 16, 2024
c24b010
windows tests
multiphaseCFD Aug 16, 2024
3546a52
add NOMINMAX macros before Windows header
multiphaseCFD Aug 16, 2024
f1799f1
remove enable_lapack from CIs
multiphaseCFD Aug 16, 2024
2294c63
revert some changes
multiphaseCFD Aug 16, 2024
3342117
ppc depends on scipy-openblas64
multiphaseCFD Aug 16, 2024
a0fc6b6
pin scipy-openblas64 to 0.3.27.0.0
multiphaseCFD Aug 16, 2024
5097351
update pyproject.toml
multiphaseCFD Aug 16, 2024
4e13727
update mac path
multiphaseCFD Aug 16, 2024
2299f6e
turn off scipy installation on ppc
multiphaseCFD Aug 16, 2024
1853242
quick fix
multiphaseCFD Aug 16, 2024
b4c71c1
std::filesystem::exists not fully supported by macos
multiphaseCFD Aug 16, 2024
b1b2d60
make format
multiphaseCFD Aug 16, 2024
6c50b77
C++ don't rely on Python.h
multiphaseCFD Aug 16, 2024
74bebd3
update cmake files
multiphaseCFD Aug 16, 2024
352e7d1
Auto update version from '0.38.0-dev35' to '0.38.0-dev36'
ringo-but-quantum Aug 16, 2024
e532e6a
Merge branch 'master' into pybind11_get_sitepackages
multiphaseCFD Aug 16, 2024
6cd71ed
Auto update version from '0.38.0-dev35' to '0.38.0-dev36'
ringo-but-quantum Aug 16, 2024
2355a0a
use scipy module to find scipy path
multiphaseCFD Aug 17, 2024
7d47297
tidy up code
multiphaseCFD Aug 17, 2024
a599094
tidy up code
multiphaseCFD Aug 17, 2024
05d9e4d
bug fix
multiphaseCFD Aug 17, 2024
a3bef4c
quick test
multiphaseCFD Aug 17, 2024
c31a445
link against lpython.so
multiphaseCFD Aug 17, 2024
fed8371
quick tests
multiphaseCFD Aug 17, 2024
35c3bd4
quick test
multiphaseCFD Aug 17, 2024
07626e5
quick fix
multiphaseCFD Aug 17, 2024
e434ede
fix typo
multiphaseCFD Aug 17, 2024
252c0a1
tix typo
multiphaseCFD Aug 17, 2024
4b40406
make format
multiphaseCFD Aug 17, 2024
3044c13
quick fix
multiphaseCFD Aug 17, 2024
f99ac4a
Merge branch 'master' into pybind11_get_sitepackages
multiphaseCFD Aug 19, 2024
49dc7a1
Auto update version from '0.38.0-dev38' to '0.38.0-dev39'
ringo-but-quantum Aug 19, 2024
488d356
quick test
multiphaseCFD Aug 19, 2024
77a8b21
update
multiphaseCFD Aug 19, 2024
2c76370
update BLASLibLoaderManager
multiphaseCFD Sep 8, 2024
8270337
Auto update version from '0.38.0-dev39' to '0.39.0-dev7'
ringo-but-quantum Sep 8, 2024
2209a6b
Update generate_samples in LK and LGPU to support qml.measurements.Sh…
maliasadi Aug 21, 2024
4c04474
Add `probs()` support to `lightning.tensor` (#830)
multiphaseCFD Aug 21, 2024
c73c477
Build and upload LGPU Linux aarch64 wheels (#815)
maliasadi Aug 21, 2024
9b2d9d3
Bugfix Dockerfile + new build system (#863)
vincentmr Aug 22, 2024
fdf9c71
Support the generalization of basis state preparation and the facade …
maliasadi Aug 22, 2024
1951544
Add `stateprep` support to `lightning.tensor` - MPS (#849)
multiphaseCFD Aug 22, 2024
9dff1f2
Revert tests for multi-controlled-zyz (#821)
maliasadi Aug 22, 2024
29fdd86
Add SetState and SetBasisState to kokkos (#861)
erick-xanadu Aug 23, 2024
caddb67
Update Pybind11 version for NP2.0 compatibility (#816)
mlxd Aug 23, 2024
4a7e8f1
Disable CI for draft PRs (#847)
anthayes92 Aug 23, 2024
a4f9e8d
Downgrade pb (#867)
mlxd Aug 23, 2024
08dfba8
Add std:: to some usual suspects (#865)
AmintorDusko Aug 26, 2024
867c3b7
Cron jobs for 0.38.0 release (#872)
vincentmr Aug 27, 2024
96894f4
Point to the right Lightning root folder independently from the invoc…
rauletorresc Aug 29, 2024
8944eed
Optimize gate cache recording for `lightning.tensor` (#879)
multiphaseCFD Aug 30, 2024
b37b483
Version Bump (#884)
github-actions[bot] Sep 3, 2024
16bb3bc
Migration of LightningKokkos to the new device API (#810)
LuisAlfredoNu Sep 4, 2024
e03d1ac
Update/actions (#887)
AmintorDusko Sep 4, 2024
ce1a320
Correctly querying wire IDs for `SetState` and `SetBasisState` in L-K…
vincentmr Sep 5, 2024
e626ac9
Chunk Hamiltonian, PauliSentence, LinearCombination [sc-65680] (#873)
vincentmr Sep 5, 2024
2d6de41
Fix the artifact name in LGPU and remove old installation commands in…
maliasadi Sep 5, 2024
1e1b273
Add controlled gate support to `lightning.tensor` (#880)
multiphaseCFD Sep 6, 2024
1e0a41b
Update Version (#898)
maliasadi Sep 6, 2024
4539036
Update Py3.9 to 3.10 minimum (#891)
mlxd Sep 6, 2024
a387ad8
Auto update version from '0.39.0-dev6' to '0.39.0-dev7'
ringo-but-quantum Sep 8, 2024
66d0a01
Merge branch 'master' into pybind11_get_sitepackages
multiphaseCFD Sep 24, 2024
6126447
Auto update version from '0.39.0-dev32' to '0.39.0-dev33'
ringo-but-quantum Sep 24, 2024
b6b5367
remove unneccessary ci workflow
multiphaseCFD Sep 24, 2024
e9c300f
remove some CI workflows
multiphaseCFD Sep 24, 2024
9e3a48d
remove ppc ci
multiphaseCFD Sep 24, 2024
6239ffe
tidy up code
multiphaseCFD Sep 24, 2024
87d898d
tidy up code
multiphaseCFD Sep 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/tests_gpu_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ jobs:
-G Ninja
cmake --build ./Build
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;
mkdir -p ./tests/results_${{ github.job }}_${{ matrix.pl_backend }}-${{ matrix.enable_lapack }}
for file in *runner ; do ./$file --order lex --reporter junit --out ./tests/results_${{ github.job }}_${{ matrix.pl_backend }}-${{ matrix.enable_lapack }}/report_$file.xml; done;
lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info
mv coverage.info coverage-${{ github.job }}-${{ matrix.pl_backend }}.info
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/tests_linux_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,11 @@ jobs:
pl_backend: ["lightning_qubit"]
enable_kernel_omp: ["OFF", "ON"]
enable_kernel_avx_streaming: ["OFF", "ON"]
enable_lapack: ["OFF", "ON"]
exclude:
- enable_kernel_omp: OFF
enable_kernel_avx_streaming: ON
timeout-minutes: 60
name: C++ Tests (${{ matrix.pl_backend }}, ENABLE_KERNEL_OMP=${{ matrix.enable_kernel_omp }}, ENABLE_KERNEL_AVX_STREAMING=${{ matrix.enable_kernel_avx_streaming }}), ENABLE_LAPACK=${{ matrix.enable_lapack }})
name: C++ Tests (${{ matrix.pl_backend }}, ENABLE_KERNEL_OMP=${{ matrix.enable_kernel_omp }}, ENABLE_KERNEL_AVX_STREAMING=${{ matrix.enable_kernel_avx_streaming }})
runs-on: ${{ needs.determine_runner.outputs.runner_group }}

steps:
Expand All @@ -74,15 +73,14 @@ jobs:
- name: Install dependencies
run: |
echo ${{ github.event_name }} && sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build gcovr lcov
python -m pip install scipy
python -m pip install scipy pybind11

- name: Build and run unit tests
run: |
cmake . -BBuild -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_TESTS=ON \
-DENABLE_PYTHON=OFF \
-DENABLE_LAPACK=${{ matrix.enable_lapack }} \
-DPL_BACKEND=${{ matrix.pl_backend }} \
-DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \
-DENABLE_COVERAGE=ON \
Expand Down Expand Up @@ -225,10 +223,11 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build gcovr lcov
python -m pip install scipy
python -m pip install scipy pybind11

- name: Build and run unit tests
run: |
set -x
cmake . -BBuild -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_TESTS=ON \
Expand All @@ -244,6 +243,7 @@ jobs:
lcov --directory . -b ../pennylane_lightning/core/src --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info
mv coverage.info coverage-${{ github.job }}-${{ matrix.pl_backend }}.info
set +x

- name: Upload test results
uses: actions/upload-artifact@v4
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/tests_lkcuda_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,8 @@ jobs:
pl_backend: ["lightning_kokkos"]
exec_model: ["CUDA"]
kokkos_version: ["4.3.01"]
enable_lapack: ["OFF", "ON"]

name: C++ Tests (${{ matrix.pl_backend }}, kokkos-${{ matrix.kokkos_version }}, model-${{ matrix.exec_model }}), enable_lapack-${{ matrix.enable_lapack }}
name: C++ Tests (${{ matrix.pl_backend }}, kokkos-${{ matrix.kokkos_version }}, model-${{ matrix.exec_model }})
runs-on:
- ${{ matrix.os }}
- self-hosted
Expand Down Expand Up @@ -186,7 +185,10 @@ jobs:


- name: Install dependencies
run: sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build gcovr lcov
run: |
sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build gcovr lcov
python -m pip install scipy pybind11


- name: Build and run unit tests
run: |
Expand All @@ -195,7 +197,6 @@ jobs:
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_TESTS=ON \
-DENABLE_PYTHON=OFF \
-DENABLE_LAPACK=${{ matrix.enable_lapack }} \
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/Kokkos \
-DPL_BACKEND=${{ matrix.pl_backend }} \
-DCMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION) \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_lqcpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,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
python -m pip install scipy wheel
python -m pip install scipy wheel pybind11

- name: Get required Python packages
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests_windows_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:

- name: Install dependencies
run: |
python -m pip install cmake build ninja scipy
python -m pip install cmake build ninja scipy pybind11

- name: Setup OpenCppCoverage and add to PATH
run: |
Expand Down Expand Up @@ -202,7 +202,7 @@ jobs:

- name: Install dependencies
run: |
python -m pip install cmake build ninja
python -m pip install cmake build ninja scipy

- name: Checkout PennyLane-Lightning
uses: actions/checkout@v4
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/wheel_macos_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,12 @@
CIBW_ENVIRONMENT: |
CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release"

PL_BACKEND: ${{ matrix.pl_backend }}
CIBW_ENVIRONMENT: |
PL_BACKEND="${{ matrix.pl_backend }}"

CIBW_BEFORE_TEST: |
python -m pip install -r requirements-tests.txt
if ${{ matrix.pl_backend == 'lightning_kokkos'}}

Check warning on line 158 in .github/workflows/wheel_macos_x86_64.yml

View check run for this annotation

codefactor.io / CodeFactor

.github/workflows/wheel_macos_x86_64.yml#L158

Duplication of key "CIBW_ENVIRONMENT" in mapping. (key-duplicates)
then
PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py
SKIP_COMPILATION=True python -m pip install . -vv
Expand Down
46 changes: 16 additions & 30 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ option(ENABLE_CLANG_TIDY "Enable clang-tidy build checks" OFF)
option(ENABLE_COVERAGE "Enable code coverage" OFF)
option(ENABLE_WARNINGS "Enable warnings" ON)
option(ENABLE_NATIVE "Enable native CPU build tuning" OFF)
option(ENABLE_PYTHON "Enable compilation of the Python module" ON)

option(ENABLE_LAPACK "Enable compilation with scipy/LAPACK" OFF)
option(ENABLE_PYTHON "Enable compilation of the Python module" OFF)

# OpenMP
find_package(OpenMP)
Expand Down Expand Up @@ -85,32 +83,8 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/process_options.cmake")

set(CMAKE_POLICY_DEFAULT_CMP0127 NEW) # To suppress pybind11 CMP0127 warning
# Add pybind11
include(FetchContent)

if(ENABLE_LAPACK)
find_package(Python COMPONENTS Interpreter Development)
set(SCIPYLIBS ${Python_SITELIB})

if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(SCIPYLIBS "/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/libLAPACK.dylib")
elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
if(EXISTS ${SCIPYLIBS}/scipy.libs)
set(SCIPYLIBS ${SCIPYLIBS}/scipy.libs)
else()
# Fallback to the lib path of Python for `conda` support
set(SCIPYLIBS ${SCIPYLIBS}/../..)
endif()
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
else()
message(FATAL_ERROR "Unsupported platform: ${CMAKE_SYSTEM_NAME}")
endif()

add_compile_definitions(SCIPY_LIBS_PATH="${SCIPYLIBS}")

message(STATUS "Python scipy-lib path: ${SCIPYLIBS}")
endif()

include(FetchContent)
if(ENABLE_PYTHON)
find_package(Python COMPONENTS Interpreter Development)
FetchContent_Declare(pybind11
Expand All @@ -120,8 +94,20 @@ if(ENABLE_PYTHON)
FetchContent_MakeAvailable(pybind11)
endif()

# Print Python site-packages directory for reference
message("Python site-packages directory: ${Python_SITELIB}")
if(SCIPY_LIBS_PATH AND NOT ENABLE_PYTHON)
add_compile_definitions(_SCIPY_LIBS_PATH="${SCIPY_LIBS_PATH}")
message(STATUS "SCIPY_LIBS_PATH: ${SCIPY_LIBS_PATH}")
elseif(ENABLE_PYTHON AND SCIPY_LIBS_PATH)
message(FATAL_ERROR "SCIPY_LIBS_PATH is only supported when ENABLE_PYTHON is OFF.")
endif()

FetchContent_Declare(pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11.git
GIT_TAG v2.11.1
)

FetchContent_MakeAvailable(pybind11)


set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})

Expand Down
4 changes: 0 additions & 4 deletions cmake/process_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,3 @@ if (UNIX AND (${CMAKE_SYSTEM_PROCESSOR} MATCHES "(AMD64)|(X64)|(x64)|(x86_64)"))
message(STATUS "ENABLE AVX for X64 on UNIX compatible system.")
target_compile_options(lightning_compile_options INTERFACE -mavx)
endif()

if(ENABLE_LAPACK)
target_compile_options(lightning_compile_options INTERFACE "-DPL_USE_LAPACK=1")
endif()
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.39.0-dev32"
__version__ = "0.39.0-dev33"
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,6 @@ TEST_CASE("Expval Shot- NamedObs", "[MeasurementsBase][Observables]") {
}
}

#ifdef PL_USE_LAPACK
template <typename TypeList> void testHermitianObsExpvalShot() {
if constexpr (!std::is_same_v<TypeList, void>) {
using StateVectorT = typename TypeList::Type;
Expand Down Expand Up @@ -677,7 +676,6 @@ TEST_CASE("Expval Shot - HermitianObs ", "[MeasurementsBase][Observables]") {
testHermitianObsExpvalShot<TestStateVectorBackends>();
}
}
#endif

template <typename TypeList> void testHermitianObsExpval() {
if constexpr (!std::is_same_v<TypeList, void>) {
Expand Down Expand Up @@ -843,7 +841,6 @@ template <typename TypeList> void testTensorProdObsExpvalShot() {
expected, static_cast<PrecisionT>(0.20)));
}

#ifdef PL_USE_LAPACK
DYNAMIC_SECTION(" With Identity and shots_range"
<< StateVectorToName<StateVectorT>::name) {
std::size_t num_shots = 80000;
Expand All @@ -864,7 +861,6 @@ template <typename TypeList> void testTensorProdObsExpvalShot() {
REQUIRE_THAT(result, Catch::Matchers::WithinRel(
expected, static_cast<PrecisionT>(0.20)));
}
#endif

testTensorProdObsExpvalShot<typename TypeList::Next>();
}
Expand Down Expand Up @@ -1015,7 +1011,6 @@ TEST_CASE("Var - HermitianObs", "[MeasurementsBase][Observables]") {
}
}

#ifdef PL_USE_LAPACK
template <typename TypeList> void testHermitianObsShotVar() {
if constexpr (!std::is_same_v<TypeList, void>) {
using StateVectorT = typename TypeList::Type;
Expand Down Expand Up @@ -1100,7 +1095,6 @@ TEST_CASE("Var - HermitianObs Shot", "[MeasurementsBase][Observables]") {
testHermitianObsShotVar<TestStateVectorBackends>();
}
}
#endif

template <typename TypeList> void testTensorProdObsVarShot() {
if constexpr (!std::is_same_v<TypeList, void>) {
Expand Down Expand Up @@ -1151,7 +1145,6 @@ template <typename TypeList> void testTensorProdObsVarShot() {
expected, static_cast<PrecisionT>(0.20)));
}

#ifdef PL_USE_LAPACK
DYNAMIC_SECTION("With Hermitian and NameObs"
<< StateVectorToName<StateVectorT>::name) {
using MatrixT = std::vector<ComplexT>;
Expand Down Expand Up @@ -1201,7 +1194,6 @@ template <typename TypeList> void testTensorProdObsVarShot() {
REQUIRE_THAT(result, Catch::Matchers::WithinRel(
expected, static_cast<PrecisionT>(0.20)));
}
#endif

DYNAMIC_SECTION(" full wires with apply operations"
<< StateVectorToName<StateVectorT>::name) {
Expand Down Expand Up @@ -1559,7 +1551,6 @@ template <typename TypeList> void testHamiltonianObsExpvalShot() {
REQUIRE_THAT(res, Catch::Matchers::WithinRel(
expected, static_cast<PrecisionT>(0.20)));
}
#ifdef PL_USE_LAPACK
DYNAMIC_SECTION("YHer" << StateVectorToName<StateVectorT>::name) {
auto Y0 = std::make_shared<NamedObs<StateVectorT>>(
"PauliY", std::vector<std::size_t>{0});
Expand All @@ -1580,7 +1571,6 @@ template <typename TypeList> void testHamiltonianObsExpvalShot() {
REQUIRE_THAT(res, Catch::Matchers::WithinRel(
expected, static_cast<PrecisionT>(0.20)));
}
#endif

testHamiltonianObsExpvalShot<typename TypeList::Next>();
}
Expand Down Expand Up @@ -1640,7 +1630,6 @@ template <typename TypeList> void testHamiltonianObsVarShot() {
expected, static_cast<PrecisionT>(0.20)));
}

#ifdef PL_USE_LAPACK
DYNAMIC_SECTION("YHer" << StateVectorToName<StateVectorT>::name) {
using ComplexT = typename StateVectorT::ComplexT;
auto Y0 = std::make_shared<NamedObs<StateVectorT>>(
Expand Down Expand Up @@ -1669,7 +1658,6 @@ template <typename TypeList> void testHamiltonianObsVarShot() {
REQUIRE_THAT(res, Catch::Matchers::WithinRel(
expected, static_cast<PrecisionT>(0.20)));
}
#endif

testHamiltonianObsVarShot<typename TypeList::Next>();
}
Expand Down
Loading
Loading