Skip to content

Commit

Permalink
Merge branch 'main' into tnguyen/multi-qpu-platform-map
Browse files Browse the repository at this point in the history
  • Loading branch information
1tnguyen authored Dec 13, 2024
2 parents b0b5f4a + 2cf6b04 commit af858f5
Show file tree
Hide file tree
Showing 15 changed files with 579 additions and 504 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ jobs:
fi
image_tag=`docker inspect $cudaq_image --format='{{json .Config.Labels}}' | jq -r '."org.opencontainers.image.version"'`
docs_version="CUDA_QUANTUM_VERSION=${image_tag%-base}"
docs_version="CUDA_QUANTUM_VERSION=$(echo $image_tag | sed -re 's/^(cu[0-9]+-)?(.*)-base$/\2/')"
docker image rm $cudaq_image
docker image prune --force
Expand Down
58 changes: 48 additions & 10 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
options:
- nightly
- anyon
- infleqtion
- ionq
- iqm
- oqc
Expand Down Expand Up @@ -335,11 +336,7 @@ jobs:
fi
- name: Setup anyon account
# This step is currently bypassed during nightly runs due to
# maintenance. Restore the if check to the original value when
# maintenance is complete.
#if: github.event_name == 'schedule' || inputs.target == 'nightly' || inputs.target == 'anyon'
if: inputs.target == 'anyon'
if: github.event_name == 'schedule' || inputs.target == 'nightly' || inputs.target == 'anyon'
run: |
curl -X POST --user "${{ secrets.ANYON_USERNAME }}:${{ secrets.ANYON_PASSWORD }}" -H "Content-Type: application/json" https://api.anyon.cloud:5000/login > credentials.json
id_token=`cat credentials.json | jq -r '."id_token"'`
Expand All @@ -348,11 +345,7 @@ jobs:
echo "refresh: $refresh_token" >> ~/.anyon_config
- name: QIR syntax check (Anyon)
# This step is currently bypassed during nightly runs due to
# maintenance. Restore the if check to the original value when
# maintenance is complete.
#if: github.event_name == 'schedule' || inputs.target == 'nightly' || inputs.target == 'anyon'
if: inputs.target == 'anyon'
if: github.event_name == 'schedule' || inputs.target == 'nightly' || inputs.target == 'anyon'
run: |
echo "### QIR syntax check (Anyon)" >> $GITHUB_STEP_SUMMARY
export CUDAQ_LOG_LEVEL="info"
Expand Down Expand Up @@ -650,6 +643,51 @@ jobs:
fi
shell: bash

- name: Submit to Infleqtion test server
if: (success() || failure()) && (inputs.target == 'infleqtion' || github.event_name == 'schedule' || inputs.target == 'nightly')
run: |
echo "### Submit to Infleqtion server" >> $GITHUB_STEP_SUMMARY
export SUPERSTAQ_API_KEY='${{ secrets.SUPERSTAQ_API_KEY }}'
set +e # Allow script to keep going through errors
test_err_sum=0
cpp_tests="docs/sphinx/targets/cpp/infleqtion.cpp"
for filename in $cpp_tests; do
[ -e "$filename" ] || echo "::error::Couldn't find file ($filename)"
nvq++ --target infleqtion $filename
test_status=$?
if [ $test_status -eq 0 ]; then
./a.out
test_status=$?
if [ $test_status -eq 0 ]; then
echo ":white_check_mark: Successfully ran test: $filename" >> $GITHUB_STEP_SUMMARY
else
echo ":x: Test failed (failed to execute): $filename" >> $GITHUB_STEP_SUMMARY
test_err_sum=$((test_err_sum+1))
fi
else
echo ":x: Test failed (failed to compile): $filename" >> $GITHUB_STEP_SUMMARY
test_err_sum=$((test_err_sum+1))
fi
done
python_tests="docs/sphinx/targets/python/infleqtion.py"
for filename in $python_tests; do
[ -e "$filename" ] || echo "::error::Couldn't find file ($filename)"
python3 $filename 1> /dev/null
test_status=$?
if [ $test_status -eq 0 ]; then
echo ":white_check_mark: Successfully ran test: $filename" >> $GITHUB_STEP_SUMMARY
else
echo ":x: Test failed (failed to execute): $filename" >> $GITHUB_STEP_SUMMARY
test_err_sum=$((test_err_sum+1))
fi
done
set -e # Re-enable exit code error checking
if [ ! $test_err_sum -eq 0 ]; then
echo "::error::${test_err_sum} tests failed. See step summary for a list of failures"
exit 1
fi
shell: bash

- name: Submit to ${{ inputs.target }}
# The full set of tests used by this step is currently only supported on
# Quantinuum. The other supported tests are tested by the step above.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
type=str,
choices=["qpp-cpu", "nvidia", "nvidia-mgpu"],
help=
"Quantum simulator backend. Default is qpp-cpu. See https://nvidia.github.io/cuda-quantum/0.6.0/using/simulators.html for more options.",
"Quantum simulator backend. Default is qpp-cpu. See https://nvidia.github.io/cuda-quantum for more options.",
)
argparser.add_argument(
"-d",
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/applications/python/vqe_advanced.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[\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"
"[\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"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/examples/python/building_kernels.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"### Applying Gates\n",
"\n",
"\n",
"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",
"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",
"\n",
"\n",
"Gates can be applied to all qubits in a register:"
Expand Down
4 changes: 3 additions & 1 deletion docs/sphinx/examples/python/building_kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ def kernel(state: cudaq.State):
# ### Applying Gates
#
#
# 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).
# 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/api/default_ops.
#
#
# Gates can be applied to all qubits in a register:
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/examples/python/executing_kernels.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"source": [
"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",
"\n",
"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`."
"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`."
]
},
{
Expand Down
31 changes: 27 additions & 4 deletions docs/sphinx/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,43 @@ CUDA-Q Releases

**latest**

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>`
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>`

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

**0.9.0**

We are very excited to share a new toolset added for modeling and manipulating the dynamics of physical systems.
The new API allows to define and execute a time evolution under arbitrary operators. For more information, take
a look at the `docs <https://nvidia.github.io/cuda-quantum/0.9.0/using/backends/dynamics.html>`__.
The 0.9.0 release furthermore includes a range of contribution to add new backends to CUDA-Q, including backends
from `Anyon Technologies <https://nvidia.github.io/cuda-quantum/0.9.0/using/backends/hardware.html#anyon-technologies-anyon-computing>`__,
`Ferimioniq <https://nvidia.github.io/cuda-quantum/0.9.0/using/backends/simulators.html#fermioniq>`__, and
`QuEra Computing <https://nvidia.github.io/cuda-quantum/0.9.0/using/backends/hardware.html#quera-computing>`__,
as well as updates to existing backends from `ORCA <https://nvidia.github.io/cuda-quantum/latest/using/backends/hardware.html#orca-computing>`__
and `OQC <https://nvidia.github.io/cuda-quantum/0.9.0/using/backends/hardware.html#oqc>`__.
We hope you enjoy the new features - also check out our new notebooks and examples to dive into CUDA-Q.

- `Docker image <https://catalog.ngc.nvidia.com/orgs/nvidia/teams/quantum/containers/cuda-quantum>`__
- `Python wheel <https://pypi.org/project/cuda-quantum/0.9.0>`__
- `C++ installer <https://github.com/NVIDIA/cuda-quantum/releases/0.9.0>`__
- `Documentation <https://nvidia.github.io/cuda-quantum/0.9.0>`__
- `Examples <https://github.com/NVIDIA/cuda-quantum/tree/releases/v0.9.0/docs/sphinx/examples>`__

The full change log can be found `here <https://github.com/NVIDIA/cuda-quantum/releases/0.9.0>`__.

**0.8.0**

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

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

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

Expand Down
4 changes: 0 additions & 4 deletions include/cudaq/Optimizer/Dialect/Quake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,3 @@
add_cudaq_dialect(Quake quake)
add_cudaq_interface(QuakeInterfaces)
add_cudaq_dialect_doc(QuakeDialect quake)

set(LLVM_TARGET_DEFINITIONS Canonical.td)
mlir_tablegen(Canonical.inc -gen-rewriters)
add_public_tablegen_target(CanonicalIncGen)
67 changes: 0 additions & 67 deletions include/cudaq/Optimizer/Dialect/Quake/Canonical.td

This file was deleted.

4 changes: 2 additions & 2 deletions lib/Optimizer/CodeGen/ConvertToQIRProfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ namespace {
/// trivial pass only does this preparation work. It performs no analysis and
/// does not rewrite function body's, etc.

static const std::vector<std::string> measurementFunctionNames{
static constexpr std::array<const char *, 3> measurementFunctionNames{
cudaq::opt::QIRMeasureBody, cudaq::opt::QIRMeasure,
cudaq::opt::QIRMeasureToRegister};

Expand Down Expand Up @@ -564,7 +564,7 @@ struct QIRProfilePreparationPass
func.getFunctionType().getParams(), module);

// Apply irreversible attribute to measurement functions
for (auto &funcName : measurementFunctionNames) {
for (auto *funcName : measurementFunctionNames) {
Operation *op = SymbolTable::lookupSymbolIn(module, funcName);
auto funcOp = llvm::dyn_cast_if_present<LLVM::LLVMFuncOp>(op);
if (funcOp) {
Expand Down
1 change: 0 additions & 1 deletion lib/Optimizer/Dialect/Quake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ add_cudaq_dialect_library(QuakeDialect
QuakeDialectIncGen
QuakeOpsIncGen
QuakeTypesIncGen
CanonicalIncGen

LINK_LIBS
CCDialect
Expand Down
Loading

0 comments on commit af858f5

Please sign in to comment.