Skip to content

Commit ee72967

Browse files
committed
Merge branch 'public25.09.1' into 'main'
Release 25.09.1 : sync with internal repo1 (commit cd0ea6c42) See merge request cuda-hpc-libraries/cuquantum-sdk/cuquantum-public!40
2 parents 26e3851 + 44b6727 commit ee72967

File tree

8 files changed

+75
-13
lines changed

8 files changed

+75
-13
lines changed

python/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ Runtime dependencies of the cuQuantum Python package include:
5252
* An NVIDIA GPU with compute capability 7.5+
5353
* Driver: Linux (525.60.13+ for CUDA 12, 580.65.06+ for CUDA 13)
5454
* CUDA Toolkit 12.x or 13.x
55-
* cuStateVec 1.10.0+
56-
* cuTensorNet 2.9.0+
57-
* cuDensityMat >=0.3.0, <0.4.0
55+
* cuStateVec 1.10.1+
56+
* cuTensorNet 2.9.1+
57+
* cuDensityMat >=0.3.1, <0.4.0
5858
* Python >=3.11, <3.14
5959
* NumPy v1.21+
6060
* nvmath-python ==0.6.0

python/cuquantum/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# Note: cuQuantum Python follows the cuQuantum SDK version, which is now
66
# switched to YY.MM and is different from individual libraries' (semantic)
77
# versioning scheme.
8-
__version__ = '25.09.0'
8+
__version__ = '25.09.1'

python/extensions/cuquantum/densitymat/jax/cppsrc/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ project(cudensitymat_jax LANGUAGES CXX)
88
set(CMAKE_CXX_STANDARD 17)
99
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1010

11-
find_package(Python3 REQUIRED REQUIRED COMPONENTS Interpreter Development)
11+
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
1212
message(STATUS "Python executable: ${Python3_EXECUTABLE}")
1313

1414
find_package(CUDAToolkit REQUIRED)
@@ -43,7 +43,7 @@ find_package(pybind11 REQUIRED)
4343

4444
# FIXME: This should be made more robust and moved to setup.py.
4545
execute_process(
46-
COMMAND ${Python3_EXECUTABLE} -c "import site; print(f'{site.getsitepackages()[0]}/cuquantum')"
46+
COMMAND ${Python3_EXECUTABLE} -c "import os; import cuquantum; print(os.path.dirname(cuquantum.__file__))"
4747
OUTPUT_STRIP_TRAILING_WHITESPACE
4848
OUTPUT_VARIABLE CUQUANTUM_PYTHON_ROOT
4949
)
@@ -85,6 +85,12 @@ else()
8585
message(STATUS "cuDensityMat library: ${CUDENSITYMAT_LIBRARY}")
8686
endif()
8787

88+
set_target_properties(
89+
${PROJECT_NAME}
90+
PROPERTIES
91+
BUILD_RPATH "$ORIGIN"
92+
)
93+
8894
target_link_libraries(
8995
${PROJECT_NAME}
9096
PRIVATE

python/extensions/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[build-system]
2-
requires = ["setuptools>=77.0.3", "wheel", "build", "jax[cuda12-local]>=0.5,<0.7", "pybind11"]
2+
requires = ["setuptools>=77.0.3", "wheel", "build", "jax[cuda12-local]>=0.5,<0.7", "pybind11", "cuquantum-python-cu12~=25.09"]
33
build-backend = "setuptools.build_meta"

python/extensions/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def finalize_options(self):
7575
with open(os.path.join(os.path.dirname(__file__), "README.md"), encoding="utf-8") as f:
7676
long_description = f.read()
7777

78-
__version__ = "0.0.1"
78+
__version__ = "0.0.2"
7979

8080
setup(
8181
name="cuquantum-python-jax",
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES
2+
#
3+
# SPDX-License-Identifier: BSD-3-Clause
4+
5+
"""
6+
MPS simulation of a noisy quantum state with unitary tensor channels.
7+
8+
The sampling is drawn with a trajectory based simulation.
9+
"""
10+
import numpy as np
11+
12+
from cuquantum.tensornet.experimental import NetworkState, MPSConfig
13+
14+
15+
def random_unitary(n):
16+
"""
17+
Create a random unitary tensor
18+
"""
19+
mat = np.random.random((2**n, 2**n)) + 1.j * np.random.random((2**n, 2**n))
20+
q, r = np.linalg.qr(mat)
21+
unitary = q.reshape((2, 2) * n)
22+
return unitary
23+
24+
25+
N = 20
26+
27+
mps_config = MPSConfig(max_extent=256,
28+
rel_cutoff=1e-5,
29+
abs_cutoff=1e-5,
30+
algorithm='gesvdj')
31+
state_mode_extents = (2,) * N
32+
dtype = 'complex128'
33+
state = NetworkState(state_mode_extents, dtype=dtype, config=mps_config)
34+
35+
np.random.seed(1)
36+
37+
h_op = (1 / np.sqrt(2)) * np.array([[1, 1], [1, -1]]).astype("complex128")
38+
39+
for i in range(N):
40+
modes_one_body = (i,)
41+
tensor_id = state.apply_tensor_operator(modes_one_body,
42+
h_op,
43+
unitary=True,
44+
immutable=True)
45+
46+
for j in range(i + 1, N):
47+
u = random_unitary(2)
48+
modes_two_body = (i, j)
49+
tensor_id = state.apply_tensor_operator(modes_two_body,
50+
u,
51+
unitary=True,
52+
immutable=True)
53+
for num_trajectories in range(2):
54+
trajectory_sample = state.compute_sampling(100)
55+
56+
state.free()

python/setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
'numpy>=1.21, <3.0', # ">=1.21,<3"
3737
'nvmath-python==0.6.0', # strict version before nvmath.internal module is stable
3838
# 'torch', # <-- PyTorch is optional; also, the PyPI version does not support GPU...
39-
f'custatevec-cu{utils.cuda_major_ver}~=1.10', # ">=1.10.0,<2"
40-
f'cutensornet-cu{utils.cuda_major_ver}~=2.9', # ">=2.9.0,<3"
41-
f'cudensitymat-cu{utils.cuda_major_ver}~=0.3.0', # ">=0.3.0,<0.4.0"
39+
f'custatevec-cu{utils.cuda_major_ver}>=1.10.1, <2', # ">=1.10.1,<2"
40+
f'cutensornet-cu{utils.cuda_major_ver}>=2.9.1, <3', # ">=2.9.1,<3"
41+
f'cudensitymat-cu{utils.cuda_major_ver}>=0.3.1, <0.4', # ">=0.3.1,<0.4.0"
4242
]
4343
if utils.cuda_major_ver == '12':
4444
install_requires.append('cupy-cuda12x>=13.0') # no ambiguity

python/tests/cuquantum_tests/tensornet/trajectories_noise/test_quantum_volume_mid_circuit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
This test uses TrajectorySim API to simulate quantum volumue circuits
99
"""
1010

11-
from qiskit.circuit.library import QuantumVolume
11+
from qiskit.circuit.library import quantum_volume
1212
from qiskit import transpile
1313

1414
import numpy as np
@@ -38,7 +38,7 @@
3838

3939

4040
def get_qvolume_circuit(n_qubits, depth, seed=SEED):
41-
circuit = QuantumVolume(n_qubits, depth, seed=seed)
41+
circuit = quantum_volume(n_qubits, depth, seed=seed)
4242
circuit.measure_all()
4343
circuit = transpile(circuit, basis_gates=["u3", "cx"], optimization_level=0)
4444
return circuit

0 commit comments

Comments
 (0)