Skip to content

Commit ad12622

Browse files
authored
Merge branch 'main' into remove_nvqc
2 parents 0b9af93 + 88816d5 commit ad12622

File tree

9 files changed

+706
-714
lines changed

9 files changed

+706
-714
lines changed
95 KB
Loading

docs/sphinx/applications/python/skqd.ipynb

Lines changed: 438 additions & 397 deletions
Large diffs are not rendered by default.

docs/sphinx/applications/python/skqd_src/pre_and_postprocessing.py

Lines changed: 210 additions & 308 deletions
Large diffs are not rendered by default.

docs/sphinx/releases.rst

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,22 @@ and is also available as a Docker image. More information about installing the n
1212
- `Documentation <https://nvidia.github.io/cuda-quantum/latest>`__
1313
- `Examples <https://github.com/NVIDIA/cuda-quantum/tree/main/docs/sphinx/examples>`__
1414

15+
**0.13.0**
16+
17+
This release adds support for CUDA 13 and Python 3.13 and removes support for
18+
CUDA 11 and Python 3.10. It adds support for using the CUDA-Q QEC libraries
19+
for real-time decoding on Quantinuum backends, and adds support for submission
20+
to QCI backends. Check out the release notes below to learn about additional
21+
new content.
22+
23+
- `Docker image <https://catalog.ngc.nvidia.com/orgs/nvidia/teams/quantum/containers/cuda-quantum/tags>`__
24+
- `Python wheel <https://pypi.org/project/cudaq/0.13.0>`__
25+
- `C++ installer <https://github.com/NVIDIA/cuda-quantum/releases/0.13.0>`__
26+
- `Documentation <https://nvidia.github.io/cuda-quantum/0.13.0>`__
27+
- `Examples <https://github.com/NVIDIA/cuda-quantum/tree/releases/v0.13.0/docs/sphinx/examples>`__
28+
29+
The full change log can be found `here <https://github.com/NVIDIA/cuda-quantum/releases/0.13.0>`__.
30+
1531
**0.12.0**
1632

1733
This release contains a range of new features and performance improvements for
@@ -23,7 +39,7 @@ Python 3.13.
2339

2440
*Note*: Support for Python 3.10 will be removed in future releases.
2541

26-
- `Docker image <https://catalog.ngc.nvidia.com/orgs/nvidia/teams/quantum/containers/cuda-quantum>`__
42+
- `Docker image <https://catalog.ngc.nvidia.com/orgs/nvidia/teams/quantum/containers/cuda-quantum/tags>`__
2743
- `Python wheel <https://pypi.org/project/cudaq/0.12.0>`__
2844
- `C++ installer <https://github.com/NVIDIA/cuda-quantum/releases/0.12.0>`__
2945
- `Documentation <https://nvidia.github.io/cuda-quantum/0.12.0>`__

docs/sphinx/snippets/python/using/examples/two_qubit_custom_op.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# the terms of the Apache License 2.0 which accompanies this distribution. #
77
# ============================================================================ #
88

9-
# fmt: off
9+
# `fmt: off`
1010
#[Begin Docs]
1111
import cudaq
1212
import numpy as np
@@ -45,4 +45,4 @@ def custom_xy_test():
4545

4646
cudaq.sample(custom_xy_test).dump() # prints { 10:1000 }
4747
#[End Docs]
48-
# fmt: on
48+
# `fmt: on`

docs/sphinx/using/backends/sims/photonics.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ Quantum Photonic States
5050
We define a qumode (qudit) to have the states
5151
:math:`\ket{0}`, :math:`\ket{1}`, ... :math:`\ket{d}` in Dirac notation where:
5252

53+
:spellcheck-disable:
54+
5355
.. math:: \ket{0} = \begin{bmatrix} 1 & 0 & 0 & \dots & 0 \end{bmatrix} ^ \top
5456

5557
.. math:: \ket{1} = \begin{bmatrix} 0 & 1 & 0 & \dots & 0 \end{bmatrix}^ \top
@@ -60,6 +62,8 @@ We define a qumode (qudit) to have the states
6062

6163
.. math:: \ket{d} = \begin{bmatrix} 0 & 0 & 0 & \dots & 1 \end{bmatrix}^ \top
6264

65+
:spellcheck-enable:
66+
6367
where the linear combinations of states or superpositions are:
6468

6569
.. math:: \ket{\psi} = \alpha_0\ket{0} + \alpha_1\ket{1} + \alpha_2\ket{2} + \dots + \alpha_d\ket{d}
@@ -94,6 +98,8 @@ qumode up to a maximum given by the qudit level :math:`d`:
9498

9599
.. math:: C \ket{0} = \ket{1}
96100

101+
:spellcheck-disable:
102+
97103
.. math:: \begin{bmatrix}
98104
0 & 0 & \dots & 0 & 0 & 0 & 0 \\
99105
1 & 0 & \dots & 0 & 0 & 0 & 0 \\
@@ -106,6 +112,8 @@ qumode up to a maximum given by the qudit level :math:`d`:
106112
\begin{bmatrix} 1 \\ 0 \\ 0 \\ \vdots \\ 0 \\ 0 \\ 0 \end{bmatrix} =
107113
\begin{bmatrix} 0 \\ 1 \\ 0 \\ \vdots \\ 0 \\ 0 \\ 0 \end{bmatrix}
108114

115+
:spellcheck-enable:
116+
109117
.. literalinclude:: ../../../snippets/python/using/examples/create_photonic_gate.py
110118
:language: python
111119
:start-after: [Begin Docs]
@@ -121,6 +129,8 @@ value 0, the operation has no effect:
121129

122130
.. math:: A \ket{1} = \ket{0}
123131

132+
:spellcheck-disable:
133+
124134
.. math:: \begin{bmatrix}
125135
1 & 1 & 0 & 0 & \dots & 0 & 0 \\
126136
0 & 0 & 1 & 0 & \dots & 0 & 0 \\
@@ -133,6 +143,8 @@ value 0, the operation has no effect:
133143
\begin{bmatrix} 0 \\ 1 \\ 0 \\ \vdots \\ 0 \\ 0 \\ 0 \end{bmatrix} =
134144
\begin{bmatrix} 1 \\ 0 \\ 0 \\ \vdots \\ 0 \\ 0 \\ 0 \end{bmatrix}
135145

146+
:spellcheck-enable:
147+
136148
.. literalinclude:: ../../../snippets/python/using/examples/annihilate_photonic_gate.py
137149
:language: python
138150
:start-after: [Begin Docs]

python/runtime/cudaq/algorithms/py_draw.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ path, i.e., the trace, of the provided `kernel`.
125125
# Output
126126
# ╭───╮╭──────────╮
127127
# q0 : ┤ h ├┤ ry(0.59) ├
128-
# ╰───╯╰──────────╯)#");
128+
# ╰───╯╰──────────╯
129+
130+
Note: This function is only available when using simulator backends.)#");
129131
}
130132

131133
} // namespace cudaq

python/tests/backends/test_Quantinuum_kernel.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,20 @@ def test():
244244
assert not '10' in counts
245245

246246

247+
def test_draw():
248+
249+
@cudaq.kernel
250+
def kernel():
251+
q = cudaq.qvector(2)
252+
h(q[0])
253+
x.ctrl(q[0], q[1])
254+
mz(q)
255+
256+
# Test here is that this does not raise an exception
257+
result = cudaq.draw(kernel)
258+
assert result is ''
259+
260+
247261
# leave for gdb debugging
248262
if __name__ == "__main__":
249263
loc = os.path.abspath(__file__)

runtime/cudaq/algorithms/draw.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
#pragma once
1010

11-
#include <concepts>
12-
1311
#include "common/ExecutionContext.h"
1412
#include "cudaq/platform.h"
13+
#include <concepts>
14+
#include <iostream>
1515

1616
namespace cudaq {
1717

@@ -32,9 +32,13 @@ cudaq::Trace traceFromKernel(KernelFunctor &&kernel, Args &&...args) {
3232
// Get the platform.
3333
auto &platform = cudaq::get_platform();
3434

35-
// This can only be done in simulation
36-
if (!platform.is_simulator())
37-
throw std::runtime_error("Cannot use draw on a physical QPU.");
35+
// This is not supported on hardware backends, but we don't want callers to
36+
// crash on unhandled exceptions.
37+
if (!platform.is_simulator()) {
38+
std::cerr << "Warning: `draw` can only be used with a simulator platform. "
39+
<< "Returning an empty trace." << std::endl;
40+
return Trace();
41+
}
3842

3943
// Create an execution context, indicate this is for tracing the execution
4044
// path
@@ -107,6 +111,7 @@ std::string extractTraceLatex(KernelFunctor &&kernel) {
107111
/// */
108112
/// \endcode
109113
///
114+
/// @note This function is only available when using simulator backends.
110115
// clang-format on
111116

112117
#if CUDAQ_USE_STD20

0 commit comments

Comments
 (0)