Skip to content
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
3b42657
Update dependencies
josephleekl Feb 23, 2026
b742617
Auto update version from '0.45.0-dev19' to '0.45.0-dev20'
ringo-but-quantum Feb 23, 2026
c89477e
Merge branch 'master' into update-deps-feb2026
josephleekl Feb 23, 2026
b4f2816
Auto update version from '0.45.0-dev20' to '0.45.0-dev21'
ringo-but-quantum Feb 23, 2026
24fb952
scipyopenblas update
josephleekl Feb 23, 2026
199c13d
try 2.11
josephleekl Feb 23, 2026
20c9edc
Merge branch 'master' into update-deps-feb2026
josephleekl Feb 25, 2026
2b58619
Auto update version from '0.45.0-dev21' to '0.45.0-dev22'
ringo-but-quantum Feb 25, 2026
9033a37
test
josephleekl Feb 25, 2026
939ff3e
update changelog
josephleekl Feb 25, 2026
946dec3
fix cmakelist and setup.py
josephleekl Feb 25, 2026
0c6f56e
Update CMakeLists.txt
josephleekl Feb 25, 2026
71369a1
Update CMakeLists.txt
josephleekl Feb 25, 2026
972e0fe
lk action cmake from pip;
josephleekl Feb 25, 2026
ea2027b
trigger CI
josephleekl Feb 25, 2026
6326a0c
trigger CI
josephleekl Feb 26, 2026
0cc650e
add gfortran
josephleekl Feb 26, 2026
d1ffc89
debug
josephleekl Feb 26, 2026
d9fc77a
debug more
josephleekl Feb 26, 2026
507bdbf
debug more 2
josephleekl Feb 26, 2026
8735e0e
test debug 3
josephleekl Feb 26, 2026
3141a22
fix test 4
josephleekl Feb 26, 2026
34f865f
test
josephleekl Feb 26, 2026
7bc1ca6
we back
josephleekl Feb 26, 2026
ecca36a
Apply suggestions from code review
josephleekl Mar 2, 2026
47b87e7
catch2 update to v3
josephleekl Mar 2, 2026
20df1d9
granular include catch header
josephleekl Mar 2, 2026
8bf36fc
add maybe_unused
josephleekl Mar 2, 2026
acf3c29
update changelog
josephleekl Mar 2, 2026
c402480
trigger CI
josephleekl Mar 2, 2026
a64ea1b
update
josephleekl Mar 2, 2026
bb7f172
Merge branch 'master' into update-deps-feb2026
josephleekl Mar 3, 2026
396c961
Auto update version from '0.45.0-dev22' to '0.45.0-dev23'
ringo-but-quantum Mar 3, 2026
28c623e
fixed order test for MPI cpp tests
josephleekl Mar 3, 2026
c958bd0
Merge branch 'update-deps-feb2026' into update-catch2-v3
josephleekl Mar 3, 2026
5e700bc
Merge branch 'master' into update-catch2-v3
josephleekl Mar 6, 2026
24560d4
Auto update version from '0.45.0-dev25' to '0.45.0-dev26'
ringo-but-quantum Mar 6, 2026
3bbae4a
trigger CI
josephleekl Mar 11, 2026
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
6 changes: 6 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@

<h3>Internal changes ⚙️</h3>

- Update Catch2 testing framework to v3.11.
[(#1350)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1350)

- Update internal dependencies versions for Nanobind (2.11), cmake (3.26), sphinxcontrib-htmlhelp (2.1.0)
[(#1347)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1347)

- Updated Github docker build action to use relevant lightning branch.
[(#1346)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1346)

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_lgpumpi_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ jobs:
mkdir -p ./tests/results
test_status=0
for file in *runner ; do ./$file --reporter junit --out ./tests/results/report_$file.xml && echo "Test $file Success!" || { cat ./tests/results/report_$file.xml; test_status=1; } done;
for file in *runner_mpi ; do mpirun -np 2 ./$file --reporter junit --out ./tests/results/report_$file.xml && echo "Test $file Success!" || { cat ./tests/results/report_$file.xml; test_status=1; } done;
for file in *runner_mpi ; do mpirun -np 2 ./$file --order decl --reporter junit --out ./tests/results/report_$file.xml && echo "Test $file Success!" || { cat ./tests/results/report_$file.xml; test_status=1; } done;
if [ $test_status -ne 0 ]; then
echo "Tests failed. Exiting with error code."
exit 1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests_lkcuda_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ 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-openblas32
sudo apt-get update && sudo apt-get -y -q install gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build gcovr lcov
python -m pip install scipy-openblas32 cmake

- name: Build and run unit tests
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests_lkmpi_cuda_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ jobs:
mkdir -p ./tests/results
test_status=0
for file in *runner ; do ./$file --reporter junit --out ./tests/results/report_$file.xml && echo "Test $file Success!" || { cat ./tests/results/report_$file.xml; test_status=1; } done;
for file in lightning_kokkos*runner_mpi ; do mpirun -np 4 ./$file --reporter junit --out ./tests/results/report_$file.xml && echo "Test $file Success!" || { cat ./tests/results/report_$file.xml; test_status=1; } done;
for file in utils_*runner_mpi ; do mpirun -np 2 ./$file --reporter junit --out ./tests/results/report_$file.xml && echo "Test $file Success!" || { cat ./tests/results/report_$file.xml; test_status=1; } done;
for file in lightning_kokkos*runner_mpi ; do mpirun -np 4 ./$file --order decl --reporter junit --out ./tests/results/report_$file.xml && echo "Test $file Success!" || { cat ./tests/results/report_$file.xml; test_status=1; } done;
for file in utils_*runner_mpi ; do mpirun -np 2 ./$file --order decl --reporter junit --out ./tests/results/report_$file.xml && echo "Test $file Success!" || { cat ./tests/results/report_$file.xml; test_status=1; } done;
if [ $test_status -ne 0 ]; then
echo "Tests failed. Exiting with error code."
exit 1
Expand Down
72 changes: 8 additions & 64 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.26)

set(LOGO [=[
░█░░░▀█▀░█▀▀░█░█░▀█▀░█▀█░▀█▀░█▀█░█▀▀░
Expand Down Expand Up @@ -88,78 +88,22 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/process_options.cmake")

if(ENABLE_PYTHON)
# Add nanobind
find_package(Python COMPONENTS Interpreter Development)
message(STATUS "Enabling Nanobind Python bindings")

# Ensure we have a valid Python executable
if(NOT Python_EXECUTABLE)
if(DEFINED PYTHON_EXECUTABLE)
set(Python_EXECUTABLE ${PYTHON_EXECUTABLE})
else()
# Try to find Python executable directly
find_program(Python_EXECUTABLE NAMES python3 python)
endif()
if(DEFINED PYTHON_EXECUTABLE AND NOT DEFINED Python_EXECUTABLE)
set(Python_EXECUTABLE "${PYTHON_EXECUTABLE}" CACHE FILEPATH
"Path to Python executable")
endif()

find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
message(STATUS "Enabling Nanobind Python bindings")
message(STATUS "Using Python executable: ${Python_EXECUTABLE}")

# Get Python include directory explicitly
execute_process(
COMMAND ${Python_EXECUTABLE} -c "import sysconfig; print(sysconfig.get_path('include'))"
OUTPUT_VARIABLE PYTHON_INCLUDE_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE PY_INCLUDE_RESULT
)

if(PY_INCLUDE_RESULT EQUAL 0 AND PYTHON_INCLUDE_DIR)
message(STATUS "Setting Python include directory: ${PYTHON_INCLUDE_DIR}")
set(Python_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR})
set(_Python_INCLUDE_DIR ${PYTHON_INCLUDE_DIR})
include_directories(${PYTHON_INCLUDE_DIR})
else()
message(WARNING "Failed to get Python include directory")
endif()

# Ensure nanobind can find Python extension suffix - try multiple methods
execute_process(
COMMAND ${Python_EXECUTABLE} -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX') or '.so')"
OUTPUT_VARIABLE NANOBIND_EXT_SUFFIX
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE PY_RESULT
)

if(NOT PY_RESULT EQUAL 0 OR NOT NANOBIND_EXT_SUFFIX)
message(WARNING "Failed to get Python extension suffix. Falling back to default '.so'")
# Fallback method
execute_process(
COMMAND ${Python_EXECUTABLE} -c "import importlib.machinery; print(importlib.machinery.EXTENSION_SUFFIXES[0] if importlib.machinery.EXTENSION_SUFFIXES else '.so')"
OUTPUT_VARIABLE NANOBIND_EXT_SUFFIX
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE PY_RESULT2
)
if(NOT PY_RESULT2 EQUAL 0 OR NOT NANOBIND_EXT_SUFFIX)
message(FATAL_ERROR "Failed to get Python extension suffix")
endif()

endif()

message(STATUS "Setting NANOBIND_EXT_SUFFIX to: ${NANOBIND_EXT_SUFFIX}")
set(ENV{NANOBIND_EXT_SUFFIX} ${NANOBIND_EXT_SUFFIX})

# Also set it as a CMake variable that nanobind can access
set(NANOBIND_EXT_SUFFIX ${NANOBIND_EXT_SUFFIX} CACHE STRING "Python extension suffix")

# Print nanobind include directory
message(STATUS "Nanobind include directory: ${nanobind_SOURCE_DIR}/include")
message(STATUS "Python version: ${Python_VERSION}")

FetchContent_Declare(nanobind
GIT_REPOSITORY https://github.com/wjakob/nanobind.git
GIT_TAG v2.8.0
GIT_TAG v2.11.0
)
FetchContent_MakeAvailable(nanobind)


endif()

# Print Python site-packages directory for reference
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -156,23 +156,23 @@ test-cpp-mpi:
$(OPTIONS)
ifdef target
cmake --build ./BuildTests $(VERBOSE) --target $(target)
mpirun -np 2 ./BuildTests/$(target)
mpirun -np 2 ./BuildTests/$(target) --order decl
else
cmake --build ./BuildTests $(VERBOSE)

if [ "$(PL_BACKEND)" = "lightning_gpu" ]; then \
for file in ./BuildTests/*_test_runner_mpi; do \
echo "Running $$file"; \
mpirun -np 2 $$file ; \
mpirun -np 2 $$file --order decl ; \
done ; \
elif [ "$(PL_BACKEND)" = "lightning_kokkos" ]; then \
for file in ./BuildTests/lightning_kokkos*test_runner_mpi; do \
echo "Running $$file"; \
mpirun -np 4 $$file ; \
mpirun -np 4 $$file --order decl ; \
done ; \
for file in ./BuildTests/utils_test_runner_mpi; do \
echo "Running $$file"; \
mpirun -np 2 $$file ; \
mpirun -np 2 $$file --order decl ; \
done; \
fi
endif
Expand Down
6 changes: 3 additions & 3 deletions cmake/support_tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ macro(FetchAndIncludeCatch)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.10
GIT_TAG v3.11.0
)

FetchContent_MakeAvailable(Catch2)
Expand All @@ -22,7 +22,7 @@ macro(FetchAndIncludeCatch)
set_target_properties(Catch2 PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${CATCH2_IID}")

# Required for catch_discover_tests() and include(Catch)
list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/contrib)
list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras)

include(Catch)
endmacro()
Expand All @@ -48,4 +48,4 @@ macro(ProcessTestOptions target_name)
message(STATUS "ENABLE_NATIVE is ON. Use -march=native for cpptests.")
target_compile_options(${target_name} INTERFACE -march=native)
endif()
endmacro()
endmacro()
2 changes: 1 addition & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sphinx-automodapi
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-htmlhelp==2.0.6
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-serializinghtml==2.0.0
pennylane-sphinx-theme
sphinxext-opengraph
Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.26)

project(lightning_components LANGUAGES CXX)

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.45.0-dev22"
__version__ = "0.45.0-dev23"
2 changes: 1 addition & 1 deletion pennylane_lightning/core/algorithms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.26)

project(lightning_algorithms LANGUAGES CXX)

Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/core/algorithms/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.26)

project(algorithms_tests)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>

#include "Error.hpp" // LightningException
#include "JacobianData.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

#include "JacobianData.hpp"
#include "TestHelpers.hpp" //PLApprox
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define CATCH_CONFIG_RUNNER
#include <catch2/catch.hpp>
#include <catch2/catch_session.hpp>
#include <mpi.h>

int main(int argc, char *argv[]) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
#include <catch2/catch_session.hpp>

int main(int argc, char *argv[]) { return Catch::Session().run(argc, argv); }
2 changes: 1 addition & 1 deletion pennylane_lightning/core/bindings/BindingsMPI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ void registerBackendAgnosticAlgorithmsMPI(nb::module_ &m) {
*
* @param m Nanobind module
*/
inline void registerInfoMPI(nb::module_ &m) {
inline void registerInfoMPI([[maybe_unused]] nb::module_ &m) {
// This function is now empty - MPI manager registration moved to
// backend-specific
}
Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/core/bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.26)

project(lightning_bindings LANGUAGES CXX)

Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/core/catalyst/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.26)

project(lightning_catalyst_core LANGUAGES CXX)

Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/core/catalyst/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.26)

project(catalyst_tests)

Expand Down
15 changes: 9 additions & 6 deletions pennylane_lightning/core/catalyst/tests/Test_LightningDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
// limitations under the License.

#include "TestHelpers.hpp"
#include "catch2/catch.hpp"
#include <algorithm>
#include <catch2/catch_test_macros.hpp>
#include <catch2/matchers/catch_matchers_string.hpp>
#include <numeric>
#include <string>

Expand Down Expand Up @@ -162,7 +163,7 @@ TEST_CASE("Check an unsupported operation", "[Driver]") {
REQUIRE_THROWS_WITH(
Lightning::lookup_gates(Lightning::simulator_gate_info,
"UnsupportedGateName"),
Catch::Contains(
Catch::Matchers::ContainsSubstring(
"The given operation is not supported by the simulator"));
}

Expand Down Expand Up @@ -447,8 +448,9 @@ TEST_CASE("Cannot reuse entangled qubit when allocating", "[Driver]") {

REQUIRE_THROWS_WITH(
sim->AllocateQubit(),
Catch::Contains("Cannot reuse qubit: qubit is entangled with remaining "
"qubits. Release qubits must be disentangled."));
Catch::Matchers::ContainsSubstring(
"Cannot reuse qubit: qubit is entangled with remaining "
"qubits. Release qubits must be disentangled."));
}

TEST_CASE("Release one qubit from entangled qubits", "[Driver]") {
Expand Down Expand Up @@ -478,8 +480,9 @@ TEST_CASE("Release one qubit from entangled qubits", "[Driver]") {

REQUIRE_THROWS_WITH(
sim->PartialProbs(probs_view, {static_qubits[0], static_qubits[1]}),
Catch::Contains("Cannot release qubits: released qubits are entangled "
"with remaining qubits"));
Catch::Matchers::ContainsSubstring(
"Cannot release qubits: released qubits are entangled "
"with remaining qubits"));
}

TEST_CASE("Release all entangled qubits", "[Driver]") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
#include <optional>
#include <set>

#include "catch2/catch.hpp"
#include <catch2/catch_test_macros.hpp>
#include <catch2/matchers/catch_matchers_string.hpp>

#include "LightningQubitManager.hpp"

Expand Down Expand Up @@ -98,12 +99,14 @@ TEST_CASE("Test lightning qubit manager invalid IDs", "[Utils]") {
size_t device_qubit_id = 0;

QubitIdType q = manager.Allocate(device_qubit_id);
REQUIRE_THROWS_WITH(manager.getProgramId(device_qubit_id + 42),
Catch::Contains("Invalid device qubit ID"));
REQUIRE_THROWS_WITH(manager.getDeviceId(q + 42),
Catch::Contains("Invalid program qubit ID"));

REQUIRE_THROWS_WITH(
manager.Release(q + 42),
Catch::Contains("Cannot release qubit, the given ID is invalid"));
manager.getProgramId(device_qubit_id + 42),
Catch::Matchers::ContainsSubstring("Invalid device qubit ID"));
REQUIRE_THROWS_WITH(
manager.getDeviceId(q + 42),
Catch::Matchers::ContainsSubstring("Invalid program qubit ID"));

REQUIRE_THROWS_WITH(manager.Release(q + 42),
Catch::Matchers::ContainsSubstring(
"Cannot release qubit, the given ID is invalid"));
}
5 changes: 3 additions & 2 deletions pennylane_lightning/core/catalyst/tests/runner_catalyst.cpp
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
#include <catch2/catch_session.hpp>

int main(int argc, char *argv[]) { return Catch::Session().run(argc, argv); }
2 changes: 1 addition & 1 deletion pennylane_lightning/core/measurements/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.26)

project(lightning_measurements LANGUAGES CXX)

Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/core/measurements/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.26)

project(measurements_tests)

Expand Down
Loading
Loading