Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
59b584f
Adding cpp integration for dynamics
sacpis Mar 3, 2025
b026c91
Adding missing file dynamics_async_tester
sacpis Mar 3, 2025
b7e7c3d
Checking if vector has any value in methods with optional return type
sacpis Mar 3, 2025
bef5286
Removing optional, fixing unittests
sacpis Mar 3, 2025
b90619b
Adding internal check change
sacpis Mar 3, 2025
88b3f48
Fixing spell check
sacpis Mar 3, 2025
24d867a
Adding examples
sacpis Mar 3, 2025
a672149
Fixing spelling
sacpis Mar 3, 2025
b083add
Adding a descriptive message
sacpis Mar 3, 2025
3a33622
Update runtime/common/EvolveResult.h
sacpis Mar 3, 2025
ad9d6f7
Formatting
sacpis Mar 3, 2025
82e693f
removing rydberg test
sacpis Mar 3, 2025
61f3a64
Removing unwanted check for --target for Python version
sacpis Mar 3, 2025
24308de
Removing std::move from the return statement to allow the compiler to…
sacpis Mar 3, 2025
cba0881
Excluding *.cpp files from dynamics
sacpis Mar 3, 2025
da4fe7d
Passing the states as const &
sacpis Mar 3, 2025
fb71004
Including cudensitymat dir as public
sacpis Mar 4, 2025
8c4ad6f
Fix DynamicsAsyncTester
1tnguyen Mar 3, 2025
6113d40
Inclduing public CUDA toolkit directory
sacpis Mar 4, 2025
145c055
Adding cublas for test_dynamics
sacpis Mar 4, 2025
5044fb9
Adding cutensorlib
sacpis Mar 4, 2025
30e2914
Adding a default constructor for the Schedule class which takes in ve…
sacpis Mar 4, 2025
1d0e714
Updating comments
sacpis Mar 4, 2025
a616205
Adding cublas and cutensor
sacpis Mar 4, 2025
50abd23
changing cudart_static to cudart to avoid linking libnvqir-dynamics t…
sacpis Mar 4, 2025
bdf8d44
Adding cpp integration for dynamics
sacpis Mar 3, 2025
b28fffb
Adding missing file dynamics_async_tester
sacpis Mar 3, 2025
df06f9f
Checking if vector has any value in methods with optional return type
sacpis Mar 3, 2025
770e35c
Removing optional, fixing unittests
sacpis Mar 3, 2025
b09ffe7
Adding internal check change
sacpis Mar 3, 2025
28c0e87
Fixing spell check
sacpis Mar 3, 2025
cd84ebd
Adding examples
sacpis Mar 3, 2025
1b83722
Fixing spelling
sacpis Mar 3, 2025
9ab74b8
Adding a descriptive message
sacpis Mar 3, 2025
7eb8a03
Update runtime/common/EvolveResult.h
sacpis Mar 3, 2025
14b12a4
Formatting
sacpis Mar 3, 2025
e086582
removing rydberg test
sacpis Mar 3, 2025
f5ca416
Removing unwanted check for --target for Python version
sacpis Mar 3, 2025
1ed0765
Removing std::move from the return statement to allow the compiler to…
sacpis Mar 3, 2025
3ccc8ca
Excluding *.cpp files from dynamics
sacpis Mar 3, 2025
c699d8b
Passing the states as const &
sacpis Mar 3, 2025
6137ff6
Including cudensitymat dir as public
sacpis Mar 4, 2025
260acc5
Fix DynamicsAsyncTester
1tnguyen Mar 3, 2025
0bf04c5
Inclduing public CUDA toolkit directory
sacpis Mar 4, 2025
3a401bd
Adding cublas for test_dynamics
sacpis Mar 4, 2025
cfd627f
Adding cutensorlib
sacpis Mar 4, 2025
3a596c2
Adding a default constructor for the Schedule class which takes in ve…
sacpis Mar 4, 2025
c05e272
Updating comments
sacpis Mar 4, 2025
7580bad
Adding cublas and cutensor
sacpis Mar 4, 2025
58f29c0
changing cudart_static to cudart to avoid linking libnvqir-dynamics t…
sacpis Mar 4, 2025
4759ed7
Skipping libnvqir-dynamics validation as one of its dependencies cont…
sacpis Mar 4, 2025
de10c30
Merge branch 'dynamics_cpp_integration' of github.com:sacpis/cuda-qua…
1tnguyen Mar 4, 2025
bf34576
Code refactor according to spec
1tnguyen Mar 4, 2025
4c8fdde
Merge branch 'main' into dynamics_cpp_integration
sacpis Mar 5, 2025
6f7a413
Accepting cudaq::dimensions_map instead of std::map
sacpis Mar 5, 2025
9e32b5f
Merge remote-tracking branch 'origin/dynamics_cpp_integration' into d…
sacpis Mar 5, 2025
b5b91ba
Fix integrator class according to spec review: snake case for public …
1tnguyen Mar 5, 2025
5c6e2b6
* Updating the evolve API signature using concepts (requires clause) to
sacpis Mar 5, 2025
94bb9e4
Formatting
sacpis Mar 5, 2025
3c299fe
Merge branch 'main' into dynamics_cpp_integration
sacpis Mar 5, 2025
6015f4c
Updating type of additional value in the comment
sacpis Mar 5, 2025
37749ca
Adding type constraint for remaining evolve APIs
sacpis Mar 5, 2025
7b0acff
Refactor runge_kutta
1tnguyen Mar 5, 2025
8367d9f
Add gpu_required label to dynamics C++ tests
1tnguyen Mar 6, 2025
0b8c5ee
* Making Schedule class name snake case
sacpis Mar 6, 2025
be2d763
Fixing parameter type
sacpis Mar 6, 2025
04b32e2
Merge remote-tracking branch 'origin/dynamics_cpp_integration' into d…
sacpis Mar 6, 2025
a6fa8e3
Fixing path to exclude
sacpis Mar 6, 2025
894f363
Merge branch 'main' into dynamics_cpp_integration
sacpis Mar 6, 2025
1ddee3c
Adding SFINAE for evolve API
sacpis Mar 6, 2025
90faa72
Merge branch 'main' into dynamics_cpp_integration
sacpis Mar 6, 2025
ed58c02
Keeping the return value as optional for evolve_result
sacpis Mar 6, 2025
63d0f4a
Merge remote-tracking branch 'origin/dynamics_cpp_integration' into d…
sacpis Mar 6, 2025
9bbb3bb
Checking for C++ version to use requires or std::enable_if_t
sacpis Mar 6, 2025
2452c51
Implementing feedback
sacpis Mar 6, 2025
2b793ab
* Updating template constarint for C++20
sacpis Mar 6, 2025
bcdcf52
Merge branch 'main' into dynamics_cpp_integration
sacpis Mar 6, 2025
07a5137
* Removing cpp dynamics examples from the exclusion list
sacpis Mar 6, 2025
1503b9b
* Removing getters as per the spec for dynamics
sacpis Mar 6, 2025
f9d3f15
Enabling dynamics tests for validation
sacpis Mar 7, 2025
1e77767
Merge remote-tracking branch 'origin/dynamics_cpp_integration' into d…
sacpis Mar 7, 2025
b0ff238
Fixing the filter for dynamics tests
sacpis Mar 7, 2025
cadf07b
Merge branch 'main' into dynamics_cpp_follow_up
sacpis Mar 7, 2025
b4445b5
Fixing syntax error
sacpis Mar 7, 2025
94ac594
adding bracket to use ||
sacpis Mar 7, 2025
5d9e7a4
Adding credits for CUDA helpers methods
sacpis Mar 7, 2025
27d11f5
Merge branch 'main' into dynamics_cpp_follow_up
sacpis Mar 7, 2025
bb09f6a
Skipping dynamics examples for non-dynamics targets
sacpis Mar 7, 2025
f9b9407
Fixing syntax
sacpis Mar 7, 2025
b1b25e0
* Fixed validation script to allow dynamics examples in publishing
sacpis Mar 7, 2025
5a82cbe
Merge branch 'main' into dynamics_cpp_follow_up
sacpis Mar 8, 2025
f1420d2
Merge branch 'main' into dynamics_cpp_follow_up
sacpis Mar 8, 2025
f68c26e
Making EvolveResult change as per the spec
sacpis Mar 10, 2025
6cfaef5
Removing unwanted method
sacpis Mar 10, 2025
8f1cd1b
use pip cache purge
bettinaheim Mar 11, 2025
5284bae
Merge branch 'main' into dynamics_cpp_follow_up
bettinaheim Mar 11, 2025
426a4c2
more cache purges
bettinaheim Mar 11, 2025
ac6a2a6
formatting
bettinaheim Mar 11, 2025
314f310
to be reverted in separate PR
bettinaheim Mar 11, 2025
f628398
reducing load on the runner and setting cmake to 3.28
bettinaheim Mar 11, 2025
adccab1
getting rid of the pip cache purge again
bettinaheim Mar 11, 2025
717131a
trying a combination of nvidia proxy cache and rapids pip retry tool
bettinaheim Mar 11, 2025
344c2bf
issue link
bettinaheim Mar 11, 2025
020092f
forgot to remove 3.10 also from the metapackage job
bettinaheim Mar 11, 2025
774afeb
Revert "issue link"
bettinaheim Mar 11, 2025
bbd3caf
Revert "trying a combination of nvidia proxy cache and rapids pip ret…
bettinaheim Mar 11, 2025
fb91afe
Revert "getting rid of the pip cache purge again"
bettinaheim Mar 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ jobs:
strategy:
matrix:
platform: [amd64, arm64]
python_version: ['3.10', '3.12']
python_version: ['3.12'] # FIXME: add '3.10' back
cuda_version: ["11.8", "12.0"]
fail-fast: false
uses: ./.github/workflows/python_wheels.yml
Expand All @@ -255,7 +255,7 @@ jobs:
uses: ./.github/workflows/python_metapackages.yml
with:
cudaq_version: ${{ needs.python_wheels.outputs.cudaq_version }}
python_versions: "['3.10', '3.12']"
python_versions: "['3.12']" # fixme: reenable 3.10
cuda_versions: "['', '11.8', '12.0']"
wheel_artifacts: 'pycudaq-*'

Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/config/validation_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"operating_systems":
[
"ubuntu:22.04",
"fedora:39",
"opensuse/leap:15.5"
"fedora:39"
]
},
{
Expand All @@ -17,8 +16,7 @@
"ubuntu:22.04",
"debian:12",
"fedora:38",
"redhat/ubi9:9.2",
"opensuse/leap:15.5"
"redhat/ubi9:9.2"
]
},
{
Expand All @@ -27,8 +25,7 @@
[
"ubuntu:24.04",
"fedora:39",
"redhat/ubi9:9.2",
"opensuse/leap:15.6"
"redhat/ubi9:9.2"
]
}
],
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ jobs:
# Unfortunately, we need to install cuquantum for docs generation to work properly,
# since using mock imports in the autodocs configuration doesn't work properly.
# See also https://github.com/sphinx-doc/sphinx/issues/11211.
docker exec cuda-quantum-dev bash -c "python3 -m pip install cuquantum-python-cu12~=24.11"
docker exec cuda-quantum-dev bash -c "python3 -m pip cache purge && python3 -m pip install cuquantum-python-cu12~=24.11"

(docker exec cuda-quantum-dev bash -c "export $docs_version && bash scripts/build_docs.sh" && built=true) || built=false
if $built; then docker cp cuda-quantum-dev:"/usr/local/cudaq/docs/." docs; \
Expand Down Expand Up @@ -820,7 +820,7 @@ jobs:
docker cp docs/notebook_validation.py cuda-quantum:"/home/cudaq/notebook_validation.py"
# In containers without GPU support, UCX does not work properly since it is configured to work with GPU-support.
# Hence, don't enforce UCX when running these tests.
docker exec cuda-quantum bash -c "python3 -m pip install pandas scipy pandas seaborn 'h5py<3.11' contfrac"
docker exec cuda-quantum bash -c "python3 -m pip cache purge && python3 -m pip install pandas scipy pandas seaborn 'h5py<3.11' contfrac"
(docker exec cuda-quantum bash -c "unset OMPI_MCA_pml && set -o pipefail && bash validate_container.sh | tee /tmp/validation.out") && passed=true || passed=false
docker cp cuda-quantum:"/tmp/validation.out" /tmp/validation.out
docker stop cuda-quantum
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -839,11 +839,10 @@ jobs:
- name: Basic validation (GPU backends)
shell: bash
run: |
# We don't test the 'dynamics' target in these tests
backends_to_test=`\
for file in $(ls $CUDA_QUANTUM_PATH/targets/*.yml); \
do
if [[ "$file" != *"dynamics"* ]] && [ -n "$(cat $file | grep "gpu-requirements")" ]; then \
if [ -n "$(cat $file | grep "gpu-requirements")" ]; then \
basename $file | cut -d "." -f 1; \
elif [ -n "$(basename $file | grep mqpu)" ]; then \
echo remote-mqpu; \
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/python_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ jobs:
matrix:
os_image: ${{ fromJSON(needs.create_test_config.outputs.json).os_images }}
pip_install_flags: ['', '--user']
exclude:
- os_image: ubuntu:22.04
pip_install_flags: '--user'
- os_image: ubuntu:24.04
pip_install_flags: '--user'
- os_image: fedora:39
pip_install_flags: ''
fail-fast: false

steps:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test_in_devenv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,9 @@ jobs:
shell: bash
run: |
cd $CUDAQ_REPO_ROOT
pip cache purge
pip install iqm_client==16.1 --user -vvv
pip install . --user -vvv
pip install . -vvv # FIXME: --user causes package hash mismatch on ubuntu...
pyinstall_status=$?
if [ ! $pyinstall_status -eq 0 ]; then
echo "::error file=test_in_devenv.yml:: Pip install of CUDA Quantum failed with status $pyinstall_status."
Expand Down
6 changes: 3 additions & 3 deletions docker/build/devdeps.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ COPY --from=prereqs /usr/local/aws "$AWS_INSTALL_PREFIX"

# Install additional dependencies required to build and test CUDA-Q.
RUN apt-get update && apt-get install --no-install-recommends -y wget ca-certificates \
&& wget https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4-linux-$(uname -m).tar.gz \
&& tar xf cmake-3.26.4* && mv cmake-3.26.4-linux-$(uname -m)/ /usr/local/cmake-3.26/ && rm -rf cmake-3.26.4* \
&& wget https://github.com/Kitware/CMake/releases/download/v3.28.4/cmake-3.28.4-linux-$(uname -m).tar.gz \
&& tar xf cmake-3.28.4* && mv cmake-3.28.4-linux-$(uname -m)/ /usr/local/cmake-3.28/ && rm -rf cmake-3.28.4* \
# NOTE: removing ca-certificates also remove python3-pip.
&& apt-get remove -y wget ca-certificates \
&& apt-get autoremove -y --purge && apt-get clean && rm -rf /var/lib/apt/lists/*
ENV PATH="${PATH}:/usr/local/cmake-3.26/bin"
ENV PATH="${PATH}:/usr/local/cmake-3.28/bin"
# We must use h5py<3.11 because 3.11 doesn't include aarch64 Linux wheels.
# https://github.com/h5py/h5py/issues/2408
RUN apt-get update && apt-get install -y --no-install-recommends \
Expand Down
2 changes: 1 addition & 1 deletion docker/build/devdeps.manylinux.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ RUN dnf install -y --nobest --setopt=install_weak_deps=False \
&& cmake --build . --target install --config Release \
&& cd / && rm -rf /pybind11-project

RUN curl -L https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4-linux-$(uname -m).sh -o cmake-install.sh \
RUN curl -L https://github.com/Kitware/CMake/releases/download/v3.28.4/cmake-3.28.4-linux-$(uname -m).sh -o cmake-install.sh \
&& bash cmake-install.sh --skip-licence --exclude-subdir --prefix=/usr/local \
&& rm cmake-install.sh

Expand Down
4 changes: 3 additions & 1 deletion docker/test/wheels/debian.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ ENV VIRTUAL_ENV=/opt/venv
RUN python${python_version} -m venv "$VIRTUAL_ENV"
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN if [ -n "$preinstalled_modules" ]; then \
python${python_version} -m pip cache purge && \
echo $preinstalled_modules | xargs python${python_version} -m pip install; \
fi

Expand All @@ -42,7 +43,8 @@ RUN if [ -n "$pip_install_flags" ]; then \
sed -i 's/include-system-site-packages = false/include-system-site-packages = true/' $VIRTUAL_ENV/pyvenv.cfg; \
fi

RUN python${python_version} -m pip install ${pip_install_flags} /tmp/$cuda_quantum_wheel
RUN python${python_version} -m pip cache purge && \
python${python_version} -m pip install ${pip_install_flags} /tmp/$cuda_quantum_wheel
RUN if [ -n "$optional_dependencies" ]; then \
cudaq_package=$(echo $cuda_quantum_wheel | cut -d '-' -f1 | tr _ -) && \
python${python_version} -m pip install ${pip_install_flags} $cudaq_package[$optional_dependencies]; \
Expand Down
4 changes: 3 additions & 1 deletion docker/test/wheels/fedora.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ RUN dnf update -y --nobest expat \
python$(echo $python_version | tr -d .) \
&& python${python_version} -m ensurepip --upgrade
RUN if [ -n "$preinstalled_modules" ]; then \
python${python_version} -m pip cache purge && \
echo $preinstalled_modules | xargs python${python_version} -m pip install; \
fi

Expand All @@ -35,7 +36,8 @@ COPY docs/sphinx/snippets/python /tmp/snippets/
COPY python/tests /tmp/tests/
COPY python/README*.md /tmp/

RUN python${python_version} -m pip install ${pip_install_flags} /tmp/$cuda_quantum_wheel
RUN python${python_version} -m pip cache purge && \
python${python_version} -m pip install ${pip_install_flags} /tmp/$cuda_quantum_wheel
RUN if [ -n "$optional_dependencies" ]; then \
cudaq_package=$(echo $cuda_quantum_wheel | cut -d '-' -f1 | tr _ -) && \
python${python_version} -m pip install ${pip_install_flags} $cudaq_package[$optional_dependencies]; \
Expand Down
4 changes: 3 additions & 1 deletion docker/test/wheels/opensuse.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ RUN zypper clean --all && zypper ref && zypper --non-interactive up --no-recomme
python$(echo ${python_version} | tr -d .) \
&& python${python_version} -m ensurepip --upgrade
RUN if [ -n "$preinstalled_modules" ]; then \
python${python_version} -m pip cache purge && \
echo $preinstalled_modules | xargs python${python_version} -m pip install; \
fi

Expand All @@ -32,7 +33,8 @@ COPY docs/sphinx/snippets/python /tmp/snippets/
COPY python/tests /tmp/tests/
COPY python/README*.md /tmp/

RUN python${python_version} -m pip install ${pip_install_flags} /tmp/$cuda_quantum_wheel
RUN python${python_version} -m pip cache purge && \
python${python_version} -m pip install ${pip_install_flags} /tmp/$cuda_quantum_wheel
RUN if [ -n "$optional_dependencies" ]; then \
cudaq_package=$(echo $cuda_quantum_wheel | cut -d '-' -f1 | tr _ -) && \
python${python_version} -m pip install ${pip_install_flags} $cudaq_package[$optional_dependencies]; \
Expand Down
4 changes: 3 additions & 1 deletion docker/test/wheels/redhat.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ RUN dnf install -y --nobest --setopt=install_weak_deps=False \
python${python_version} \
&& python${python_version} -m ensurepip --upgrade
RUN if [ -n "$preinstalled_modules" ]; then \
python${python_version} -m pip cache purge && \
echo $preinstalled_modules | xargs python${python_version} -m pip install; \
fi

Expand All @@ -31,7 +32,8 @@ COPY docs/sphinx/snippets/python /tmp/snippets/
COPY python/tests /tmp/tests/
COPY python/README*.md /tmp/

RUN python${python_version} -m pip install ${pip_install_flags} /tmp/$cuda_quantum_wheel
RUN python${python_version} -m pip cache purge && \
python${python_version} -m pip install ${pip_install_flags} /tmp/$cuda_quantum_wheel
RUN if [ -n "$optional_dependencies" ]; then \
cudaq_package=$(echo $cuda_quantum_wheel | cut -d '-' -f1 | tr _ -) && \
python${python_version} -m pip install ${pip_install_flags} $cudaq_package[$optional_dependencies]; \
Expand Down
4 changes: 3 additions & 1 deletion docker/test/wheels/ubuntu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ ENV VIRTUAL_ENV=/opt/venv
RUN python${python_version} -m venv "$VIRTUAL_ENV"
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN if [ -n "$preinstalled_modules" ]; then \
python${python_version} -m pip cache purge && \
echo $preinstalled_modules | xargs python${python_version} -m pip install; \
fi

Expand All @@ -38,7 +39,8 @@ COPY python/README*.md /tmp/

RUN sed -ie 's/include-system-site-packages\s*=\s*false/include-system-site-packages = true/g' "$VIRTUAL_ENV/pyvenv.cfg"

RUN python${python_version} -m pip install ${pip_install_flags} /tmp/$cuda_quantum_wheel
RUN python${python_version} -m pip cache purge && \
python${python_version} -m pip install ${pip_install_flags} /tmp/$cuda_quantum_wheel
RUN if [ -n "$optional_dependencies" ]; then \
cudaq_package=$(echo $cuda_quantum_wheel | cut -d '-' -f1 | tr _ -) && \
python${python_version} -m pip install ${pip_install_flags} $cudaq_package[$optional_dependencies]; \
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/examples/cpp/dynamics/cavity_qed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ int main() {
auto get_expectation = [](int idx, auto &result) -> std::vector<double> {
std::vector<double> expectations;

auto all_exps = result.get_expectation_values().value();
auto all_exps = result.expectation_values.value();
for (auto exp_vals : all_exps) {
expectations.push_back((double)exp_vals[idx]);
}
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/examples/cpp/dynamics/cross_resonance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ int main() {
auto get_expectation = [](int idx, auto &result) -> std::vector<double> {
std::vector<double> expectations;

auto all_exps = result.get_expectation_values().value();
auto all_exps = result.expectation_values.value();
for (auto exp_vals : all_exps) {
expectations.push_back((double)exp_vals[idx]);
}
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/examples/cpp/dynamics/heisenberg_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ int main() {
auto get_expectation = [](int idx, auto &result) -> std::vector<double> {
std::vector<double> expectations;

auto all_exps = result.get_expectation_values().value();
auto all_exps = result.expectation_values.value();
for (auto exp_vals : all_exps) {
expectations.push_back((double)exp_vals[idx]);
}
Expand Down
7 changes: 3 additions & 4 deletions docs/sphinx/examples/cpp/dynamics/qubit_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ int main() {
// 2. A time-dependent driving term: omega_x * cos(omega_drive * t) * `Sx`_0,
// which induces rotations about the X-axis. The scalar_operator(mod_`func`)
// allows the drive term to vary in time according to mod_`func`.
auto hamiltonian =
0.5 * omega_z * cudaq::spin_operator::z(0) +
omega_x * cudaq::scalar_operator(mod_func) * cudaq::spin_operator::x(0);
auto hamiltonian = 0.5 * omega_z * cudaq::spin_operator::z(0) +
mod_func * cudaq::spin_operator::x(0) * omega_x;

// A single qubit with dimension 2.
cudaq::dimension_map dimensions = {{0, 2}};
Expand Down Expand Up @@ -100,7 +99,7 @@ int main() {
auto get_expectation = [](int idx, auto &result) -> std::vector<double> {
std::vector<double> expectations;

auto all_exps = result.get_expectation_values().value();
auto all_exps = result.expectation_values.value();
for (auto exp_vals : all_exps) {
expectations.push_back(exp_vals[idx].expectation());
}
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/examples/cpp/dynamics/qubit_dynamics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ int main() {
auto get_expectation = [](int idx, auto &result) -> std::vector<double> {
std::vector<double> expectations;

auto all_exps = result.get_expectation_values().value();
auto all_exps = result.expectation_values.value();
for (auto exp_vals : all_exps) {
expectations.push_back((double)exp_vals[idx]);
}
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ visualization = [ "qutip<5" , "matplotlib>=3.5" ]
integrators = [ "torchdiffeq" ]

[build-system]
requires = ["scikit-build-core==0.9.10", "cmake>=3.26,<3.29", "numpy>=1.24", "pytest==8.2.0"]
requires = ["scikit-build-core==0.9.10", "cmake>=3.27,<3.29", "numpy>=1.24", "pytest==8.2.0"]
build-backend = "scikit_build_core.build"

[tool.scikit-build]
Expand Down
10 changes: 4 additions & 6 deletions python/runtime/common/py_EvolveResult.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,22 @@ void bindEvolveResult(py::module &mod) {
.def(py::init<std::vector<state>, std::vector<std::vector<double>>>())
.def(
"final_state",
[](evolve_result &self) { return self.get_final_state(); },
[](evolve_result &self) { return self.states->back(); },
"Stores the final state produced by a call to :func:`evolve`. "
"Represent the state of a quantum system after time evolution under "
"a set of operators, see the :func:`evolve` documentation for more "
"detail.\n")
.def(
"intermediate_states",
[](evolve_result &self) { return self.get_intermediate_states(); },
[](evolve_result &self) { return self.states; },
"Stores all intermediate states, meaning the state after each step "
"in a defined schedule, produced by a call to :func:`evolve`, "
"including the final state. This property is only populated if "
"saving intermediate results was requested in the call to "
":func:`evolve`.\n")
.def(
"final_expectation_values",
[](evolve_result &self) {
return self.get_final_expectation_values();
},
[](evolve_result &self) { return self.expectation_values; },
"Stores the final expectation values, that is the results produced "
"by "
"calls to :func:`observe`, triggered by a call to :func:`evolve`. "
Expand All @@ -63,7 +61,7 @@ void bindEvolveResult(py::module &mod) {
"call.\n")
.def(
"expectation_values",
[](evolve_result &self) { return self.get_expectation_values(); },
[](evolve_result &self) { return self.expectation_values; },
"Stores the expectation values, that is the results from the calls "
"to "
":func:`observe`, at each step in the schedule produced by a call to "
Expand Down
Loading
Loading