Skip to content

Commit 52a1ac8

Browse files
authored
Merge branch 'main' into ch-canonical.pattern
2 parents 4c3fb48 + 95134fd commit 52a1ac8

File tree

10 files changed

+87
-13
lines changed

10 files changed

+87
-13
lines changed

.github/workflows/docker_images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ jobs:
694694
fi
695695
696696
image_tag=`docker inspect $cudaq_image --format='{{json .Config.Labels}}' | jq -r '."org.opencontainers.image.version"'`
697-
docs_version="CUDA_QUANTUM_VERSION=${image_tag%-base}"
697+
docs_version="CUDA_QUANTUM_VERSION=$(echo $image_tag | sed -re 's/^(cu[0-9]+-)?(.*)-base$/\2/')"
698698
docker image rm $cudaq_image
699699
docker image prune --force
700700

.github/workflows/integration_tests.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ on:
1717
options:
1818
- nightly
1919
- anyon
20+
- infleqtion
2021
- ionq
2122
- iqm
2223
- oqc
@@ -650,6 +651,51 @@ jobs:
650651
fi
651652
shell: bash
652653

654+
- name: Submit to Infleqtion test server
655+
if: (success() || failure()) && (inputs.target == 'infleqtion' || github.event_name == 'schedule' || inputs.target == 'nightly')
656+
run: |
657+
echo "### Submit to Infleqtion server" >> $GITHUB_STEP_SUMMARY
658+
export SUPERSTAQ_API_KEY='${{ secrets.SUPERSTAQ_API_KEY }}'
659+
set +e # Allow script to keep going through errors
660+
test_err_sum=0
661+
cpp_tests="docs/sphinx/targets/cpp/infleqtion.cpp"
662+
for filename in $cpp_tests; do
663+
[ -e "$filename" ] || echo "::error::Couldn't find file ($filename)"
664+
nvq++ --target infleqtion $filename
665+
test_status=$?
666+
if [ $test_status -eq 0 ]; then
667+
./a.out
668+
test_status=$?
669+
if [ $test_status -eq 0 ]; then
670+
echo ":white_check_mark: Successfully ran test: $filename" >> $GITHUB_STEP_SUMMARY
671+
else
672+
echo ":x: Test failed (failed to execute): $filename" >> $GITHUB_STEP_SUMMARY
673+
test_err_sum=$((test_err_sum+1))
674+
fi
675+
else
676+
echo ":x: Test failed (failed to compile): $filename" >> $GITHUB_STEP_SUMMARY
677+
test_err_sum=$((test_err_sum+1))
678+
fi
679+
done
680+
python_tests="docs/sphinx/targets/python/infleqtion.py"
681+
for filename in $python_tests; do
682+
[ -e "$filename" ] || echo "::error::Couldn't find file ($filename)"
683+
python3 $filename 1> /dev/null
684+
test_status=$?
685+
if [ $test_status -eq 0 ]; then
686+
echo ":white_check_mark: Successfully ran test: $filename" >> $GITHUB_STEP_SUMMARY
687+
else
688+
echo ":x: Test failed (failed to execute): $filename" >> $GITHUB_STEP_SUMMARY
689+
test_err_sum=$((test_err_sum+1))
690+
fi
691+
done
692+
set -e # Re-enable exit code error checking
693+
if [ ! $test_err_sum -eq 0 ]; then
694+
echo "::error::${test_err_sum} tests failed. See step summary for a list of failures"
695+
exit 1
696+
fi
697+
shell: bash
698+
653699
- name: Submit to ${{ inputs.target }}
654700
# The full set of tests used by this step is currently only supported on
655701
# Quantinuum. The other supported tests are tested by the step above.

docs/sphinx/applications/python/divisive_clustering_src/main_divisive_clustering.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
type=str,
2828
choices=["qpp-cpu", "nvidia", "nvidia-mgpu"],
2929
help=
30-
"Quantum simulator backend. Default is qpp-cpu. See https://nvidia.github.io/cuda-quantum/0.6.0/using/simulators.html for more options.",
30+
"Quantum simulator backend. Default is qpp-cpu. See https://nvidia.github.io/cuda-quantum for more options.",
3131
)
3232
argparser.add_argument(
3333
"-d",

docs/sphinx/applications/python/vqe_advanced.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@
331331
"name": "stdout",
332332
"output_type": "stream",
333333
"text": [
334-
"[\u001b[38;2;255;000;000mwarning\u001b[0m] Target \u001b[38;2;000;000;255mnvidia-mqpu\u001b[0m: \u001b[38;2;000;000;255mThis target is deprecating. Please use the 'nvidia' target with option 'mqpu,fp32' or 'mqpu' (fp32 is the default precision option) by adding the command line option '--target-option mqpu,fp32' or passing it as cudaq.set_target('nvidia', option='mqpu,fp32') in Python. Please refer to CUDA-Q \u001b]8;;https://nvidia.github.io/cuda-quantum/latest/using/backends/platform.html#nvidia-mqpu-platform\u001b\\documentation\u001b]8;;\u001b\\ for more information.\u001b[0m\n"
334+
"[\u001b[38;2;255;000;000mwarning\u001b[0m] Target \u001b[38;2;000;000;255mnvidia-mqpu\u001b[0m: \u001b[38;2;000;000;255mThis target is deprecating. Please use the 'nvidia' target with option 'mqpu,fp32' or 'mqpu' (fp32 is the default precision option) by adding the command line option '--target-option mqpu,fp32' or passing it as cudaq.set_target('nvidia', option='mqpu,fp32') in Python. Please refer to CUDA-Q \u001b]8;;https://nvidia.github.io/cuda-quantum/latest/using/backends/platform\u001b\\documentation\u001b]8;;\u001b\\ for more information.\u001b[0m\n"
335335
]
336336
}
337337
],

docs/sphinx/examples/python/building_kernels.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
"### Applying Gates\n",
146146
"\n",
147147
"\n",
148-
"After a kernel is constructed, gates can be applied to start building out a quantum circuit. All the predefined gates in CUDA-Q can be found [here](https://nvidia.github.io/cuda-quantum/latest/api/default_ops.html#unitary-operations-on-qubits).\n",
148+
"After a kernel is constructed, gates can be applied to start building out a quantum circuit. All the predefined gates in CUDA-Q can be found [here](https://nvidia.github.io/cuda-quantum/latest/api/default_ops).\n",
149149
"\n",
150150
"\n",
151151
"Gates can be applied to all qubits in a register:"

docs/sphinx/examples/python/building_kernels.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ def kernel(state: cudaq.State):
100100
# ### Applying Gates
101101
#
102102
#
103-
# After a kernel is constructed, gates can be applied to start building out a quantum circuit. All the predefined gates in CUDA-Q can be found [here](https://nvidia.github.io/cuda-quantum/latest/api/default_ops.html#unitary-operations-on-qubits).
103+
# After a kernel is constructed, gates can be applied to start building out a quantum circuit.
104+
# All the predefined gates in CUDA-Q can be found here:
105+
# https://nvidia.github.io/cuda-quantum/api/default_ops.
104106
#
105107
#
106108
# Gates can be applied to all qubits in a register:

docs/sphinx/examples/python/executing_kernels.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"source": [
7979
"Note that there is a subtle difference between how `sample` is executed with the target device set to a simulator or with the target device set to a QPU. In simulation mode, the quantum state is built once and then sampled $s$ times where $s$ equals the `shots_count`. In hardware execution mode, the quantum state collapses upon measurement and hence needs to be rebuilt over and over again.\n",
8080
"\n",
81-
"There are a number of helpful tools that can be found in the API [here](https://nvidia.github.io/cuda-quantum/latest/api/languages/python_api.html#cudaq.SampleResult) to process the `Sample_Result` object produced by `sample`."
81+
"There are a number of helpful tools that can be found in the [API docs](https://nvidia.github.io/cuda-quantum/latest/api/languages/python_api) to process the `Sample_Result` object produced by `sample`."
8282
]
8383
},
8484
{

docs/sphinx/releases.rst

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,43 @@ CUDA-Q Releases
44

55
**latest**
66

7-
The latest version of CUDA-Q is on the main branch of our `GitHub repository <https://github.com/NVIDIA/cuda-quantum>`__ and is also available as a Docker image. More information about installing the nightly builds can be found :doc:`here <using/install/install>`
7+
The latest version of CUDA-Q is on the main branch of our `GitHub repository <https://github.com/NVIDIA/cuda-quantum>`__
8+
and is also available as a Docker image. More information about installing the nightly builds can be found
9+
:doc:`here <using/install/install>`
810

911
- `Docker image (nightly builds) <https://catalog.ngc.nvidia.com/orgs/nvidia/teams/nightly/containers/cuda-quantum>`__
1012
- `Documentation <https://nvidia.github.io/cuda-quantum/latest>`__
1113
- `Examples <https://github.com/NVIDIA/cuda-quantum/tree/main/docs/sphinx/examples>`__
1214

15+
**0.9.0**
16+
17+
We are very excited to share a new toolset added for modeling and manipulating the dynamics of physical systems.
18+
The new API allows to define and execute a time evolution under arbitrary operators. For more information, take
19+
a look at the `docs <https://nvidia.github.io/cuda-quantum/0.9.0/using/backends/dynamics.html>`__.
20+
The 0.9.0 release furthermore includes a range of contribution to add new backends to CUDA-Q, including backends
21+
from `Anyon Technologies <https://nvidia.github.io/cuda-quantum/0.9.0/using/backends/hardware.html#anyon-technologies-anyon-computing>`__,
22+
`Ferimioniq <https://nvidia.github.io/cuda-quantum/0.9.0/using/backends/simulators.html#fermioniq>`__, and
23+
`QuEra Computing <https://nvidia.github.io/cuda-quantum/0.9.0/using/backends/hardware.html#quera-computing>`__,
24+
as well as updates to existing backends from `ORCA <https://nvidia.github.io/cuda-quantum/latest/using/backends/hardware.html#orca-computing>`__
25+
and `OQC <https://nvidia.github.io/cuda-quantum/0.9.0/using/backends/hardware.html#oqc>`__.
26+
We hope you enjoy the new features - also check out our new notebooks and examples to dive into CUDA-Q.
27+
28+
- `Docker image <https://catalog.ngc.nvidia.com/orgs/nvidia/teams/quantum/containers/cuda-quantum>`__
29+
- `Python wheel <https://pypi.org/project/cuda-quantum/0.9.0>`__
30+
- `C++ installer <https://github.com/NVIDIA/cuda-quantum/releases/0.9.0>`__
31+
- `Documentation <https://nvidia.github.io/cuda-quantum/0.9.0>`__
32+
- `Examples <https://github.com/NVIDIA/cuda-quantum/tree/releases/v0.9.0/docs/sphinx/examples>`__
33+
34+
The full change log can be found `here <https://github.com/NVIDIA/cuda-quantum/releases/0.9.0>`__.
35+
1336
**0.8.0**
1437

1538
The 0.8.0 release adds a range of changes to improve the ease of use and performance with CUDA-Q.
1639
The changes listed below highlight some of what we think will be the most useful features and changes
1740
to know about. While the listed changes do not capture all of the great contributions, we would like
1841
to extend many thanks for every contribution, in particular those from external contributors.
1942

20-
- `Docker image <https://catalog.ngc.nvidia.com/orgs/nvidia/teams/quantum/containers/cuda-quantum>`__
43+
- `Docker image <https://catalog.ngc.nvidia.com/orgs/nvidia/teams/quantum/containers/cuda-quantum/tags>`__
2144
- `Python wheel <https://pypi.org/project/cuda-quantum/0.8.0>`__
2245
- `C++ installer <https://github.com/NVIDIA/cuda-quantum/releases/0.8.0>`__
2346
- `Documentation <https://nvidia.github.io/cuda-quantum/0.8.0>`__
@@ -30,7 +53,7 @@ The full change log can be found `here <https://github.com/NVIDIA/cuda-quantum/r
3053
The 0.7.1 release adds simulator optimizations with significant performance improvements and
3154
extends their functionalities. The `nvidia-mgpu` backend now supports user customization of the
3255
gate fusion level as controlled by the `CUDAQ_MGPU_FUSE` environment variable documented
33-
`here <https://nvidia.github.io/cuda-quantum/latest/using/backends/simulators.html>`__.
56+
`here <https://nvidia.github.io/cuda-quantum/0.7.1/using/backends/simulators.html>`__.
3457
It furthermore adds a range of bug fixes and changes the Python wheel installation instructions.
3558

3659
- `Docker image <https://catalog.ngc.nvidia.com/orgs/nvidia/teams/quantum/containers/cuda-quantum/tags>`__
@@ -46,7 +69,7 @@ The full change log can be found `here <https://github.com/NVIDIA/cuda-quantum/r
4669
The 0.7.0 release adds support for using :doc:`NVIDIA Quantum Cloud <using/backends/nvqc>`,
4770
giving you access to our most powerful GPU-accelerated simulators even if you don't have an NVIDIA GPU.
4871
With 0.7.0, we have furthermore greatly increased expressiveness of the Python and C++ language frontends.
49-
Check out our `documentation <https://nvidia.github.io/cuda-quantum/latest/using/quick_start.html>`__
72+
Check out our `documentation <https://nvidia.github.io/cuda-quantum/0.7.0/using/quick_start.html>`__
5073
to get started with the new Python syntax support we have added, and `follow our blog <https://developer.nvidia.com/cuda-q>`__
5174
to learn more about the new setup and its performance benefits.
5275

lib/Optimizer/CodeGen/ConvertToQIRProfile.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ namespace {
516516
/// trivial pass only does this preparation work. It performs no analysis and
517517
/// does not rewrite function body's, etc.
518518

519-
static const std::vector<std::string> measurementFunctionNames{
519+
static constexpr std::array<const char *, 3> measurementFunctionNames{
520520
cudaq::opt::QIRMeasureBody, cudaq::opt::QIRMeasure,
521521
cudaq::opt::QIRMeasureToRegister};
522522

@@ -564,7 +564,7 @@ struct QIRProfilePreparationPass
564564
func.getFunctionType().getParams(), module);
565565

566566
// Apply irreversible attribute to measurement functions
567-
for (auto &funcName : measurementFunctionNames) {
567+
for (auto *funcName : measurementFunctionNames) {
568568
Operation *op = SymbolTable::lookupSymbolIn(module, funcName);
569569
auto funcOp = llvm::dyn_cast_if_present<LLVM::LLVMFuncOp>(op);
570570
if (funcOp) {

runtime/nvqir/custatevec/CuStateVecCircuitSimulator.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ class CuStateVecCircuitSimulator
216216
void *newDeviceStateVector;
217217
HANDLE_CUDA_ERROR(cudaMalloc((void **)&newDeviceStateVector,
218218
stateDimension * sizeof(CudaDataType)));
219-
219+
HANDLE_CUDA_ERROR(cudaMemset(newDeviceStateVector, 0,
220+
stateDimension * sizeof(CudaDataType)));
220221
// Place the state data on device. Could be that
221222
// we just need the zero state, or the user could have provided one
222223
void *otherState;
@@ -283,6 +284,8 @@ class CuStateVecCircuitSimulator
283284
void *newDeviceStateVector;
284285
HANDLE_CUDA_ERROR(cudaMalloc((void **)&newDeviceStateVector,
285286
stateDimension * sizeof(CudaDataType)));
287+
HANDLE_CUDA_ERROR(cudaMemset(newDeviceStateVector, 0,
288+
stateDimension * sizeof(CudaDataType)));
286289
constexpr int32_t threads_per_block = 256;
287290
uint32_t n_blocks =
288291
(stateDimension + threads_per_block - 1) / threads_per_block;

0 commit comments

Comments
 (0)