Skip to content

Commit

Permalink
Merge branch 'main' of github.com:justinlietz/cudaqx into first_shot_…
Browse files Browse the repository at this point in the history
…memory
  • Loading branch information
justinlietz committed Jan 29, 2025
2 parents 1a162a8 + b8083bd commit cd91e1d
Show file tree
Hide file tree
Showing 11 changed files with 1,006 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .cudaq_version
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"cudaq": {
"repository": "NVIDIA/cuda-quantum",
"ref": "a87e307a0b89b41e07f82a0629da67f26a8d9c85"
"ref": "bd499151326950ffb163b2afb928ca882f926ab4"
}
}
2 changes: 1 addition & 1 deletion .github/workflows/build_wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:

- name: Build CUDAQ toolchain
run: |
.github/workflows/scripts/build_cudaq.sh ${{ matrix.python }}
.github/workflows/scripts/build_cudaq.sh --python-version ${{ matrix.python }}
- name: Build CUDA-QX wheels
run: |
Expand Down
60 changes: 57 additions & 3 deletions .github/workflows/scripts/build_cudaq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,62 @@
# the terms of the Apache License 2.0 which accompanies this distribution. #
# ============================================================================ #

# ==============================================================================
# Handling options
# ==============================================================================

show_help() {
echo "Usage: $0 [options]"
echo "Options:"
echo " --python-version Python version to build wheel for (e.g. 3.10)"
echo " -j Number of parallel jobs to build CUDA-Q with"
echo " (e.g. 8)"
}

parse_options() {
while (( $# > 0 )); do
case "$1" in
--python-version)
if [[ -n "$2" && "$2" != -* ]]; then
python_version=("$2")
shift 2
else
echo "Error: Argument for $1 is missing" >&2
exit 1
fi
;;
-j)
if [[ -n "$2" && "$2" != -* ]]; then
num_par_jobs=("$2")
cudaq_ninja_jobs_arg="-j $num_par_jobs"
shift 2
else
echo "Error: Argument for $1 is missing" >&2
exit 1
fi
;;
-*)
echo "Error: Unknown option $1" >&2
show_help
exit 1
;;
*)
echo "Error: Unknown argument $1" >&2
show_help
exit 1
;;
esac
done
}

# Defaults
python_version=3.10
cudaq_ninja_jobs_arg=""

# Parse options
parse_options "$@"


export CUDA_VERSION=12.0

# We need to use a newer toolchain because CUDA-QX libraries rely on c++20
Expand All @@ -16,8 +72,6 @@ source /opt/rh/gcc-toolset-11/enable
export CC=gcc
export CXX=g++

python_version=$1
python_version=${python_version:-3.10}
python=python${python_version}
${python} -m pip install --no-cache-dir numpy auditwheel

Expand Down Expand Up @@ -69,5 +123,5 @@ echo "$CUDAQ_PATCH" | git apply --verbose

$python -m venv --system-site-packages .venv
source .venv/bin/activate
CUDAQ_BUILD_TESTS=FALSE bash scripts/build_cudaq.sh -v
CUDAQ_BUILD_TESTS=FALSE bash scripts/build_cudaq.sh -v ${cudaq_ninja_jobs_arg}

24 changes: 13 additions & 11 deletions docs/sphinx/api/core/cpp_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,36 @@ Namespaces
:desc-only:
.. doxygennamespace:: cudaq::qec::steane
:desc-only:
.. doxygennamespace:: cudaq::qec::surface_code
:desc-only:
.. doxygennamespace:: cudaq::qec::repetition
:desc-only:
.. doxygennamespace:: cudaq::solvers
:desc-only:
.. doxygennamespace:: cudaq::solvers::stateprep
.. doxygennamespace:: cudaq::solvers::stateprep
:desc-only:
.. doxygennamespace:: cudaq::solvers::adapt
:desc-only:
.. doxygennamespace:: cudaq::optim
:desc-only:

Core
Core
=============

.. doxygenclass:: cudaqx::extension_point
.. doxygenclass:: cudaqx::extension_point
:members:

.. doxygenclass:: cudaqx::heterogeneous_map
.. doxygenclass:: cudaqx::heterogeneous_map
:members:

.. doxygenclass:: cudaqx::tear_down
:members:

.. doxygenclass:: cudaqx::details::tensor_impl
:members:
.. doxygenclass:: cudaqx::details::tensor_impl
:members:

.. doxygenclass:: cudaqx::tensor
:members:
.. doxygenclass:: cudaqx::graph
:members:
.. doxygenclass:: cudaqx::tensor
:members:

.. doxygenclass:: cudaqx::graph
:members:
8 changes: 7 additions & 1 deletion docs/sphinx/api/qec/cpp_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,20 @@ CUDA-Q QEC C++ API
.. doxygenclass:: cudaq::qec::steane::steane
:members:

.. doxygenclass:: cudaq::qec::surface_code::stabilizer_grid
:members:

.. doxygenclass:: cudaq::qec::surface_code::surface_code
:members:

.. doxygenclass:: cudaq::qec::repetition::repetition
:members:

.. doxygenclass:: cudaq::qec::code
:members:

.. doxygenenum:: cudaq::qec::operation

.. doxygenfunction:: cudaq::qec::sample_code_capacity(const cudaqx::tensor<uint8_t> &, std::size_t, double)
.. doxygenfunction:: cudaq::qec::sample_code_capacity(const cudaqx::tensor<uint8_t> &, std::size_t, double, unsigned)
.. doxygenfunction:: cudaq::qec::sample_code_capacity(const code &, std::size_t, double)
Expand Down
Loading

0 comments on commit cd91e1d

Please sign in to comment.