Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
a48b47f
Merge in dynamics work and squash commit history (#12)
anthony-santana Jan 9, 2025
f69e10b
Cleaning up docs preview for PR #12.
cuda-quantum-bot Jan 9, 2025
1c86e04
Merge pull request #17 from anthony-santana/operators
sacpis Jan 9, 2025
2d88e7e
fixing spellings
sacpis Jan 9, 2025
b4b8244
Adding base_integrator and base_time_stepper
sacpis Jan 9, 2025
c194083
just some test renaming to make it easier to find
bettinaheim Jan 13, 2025
494c05a
a bunch of templates to draft how dragging type information through t…
bettinaheim Jan 13, 2025
ede8481
wip to use elementary_operator as matrix handler
bettinaheim Jan 14, 2025
790d1b2
wip to use elementary_operator as matrix handler
bettinaheim Jan 14, 2025
8fd71c5
kinded of more cleaned up but left-hand arithmethics need more thought
bettinaheim Jan 14, 2025
df6f5d3
constrain the templates
bettinaheim Jan 14, 2025
3b3460e
making the left hand arithmetics friends
bettinaheim Jan 14, 2025
19ffd26
cleaned up assignments
bettinaheim Jan 15, 2025
e264bef
fixing a some types
bettinaheim Jan 16, 2025
e597171
this builds, but needs to be cleaned up
bettinaheim Jan 16, 2025
4f8b6d8
scalar ops tests
bettinaheim Jan 17, 2025
3cbab20
to be deleted again - just some notes
bettinaheim Jan 23, 2025
3732ce0
more memory experiments
bettinaheim Jan 24, 2025
29f0b10
revised the data structures - all tests now pass again
bettinaheim Jan 24, 2025
bf02919
store one coefficient per product only
bettinaheim Jan 27, 2025
fde0991
getting rid of all elementary operator overloads
bettinaheim Jan 27, 2025
35bff4f
clean up for scalars
bettinaheim Jan 28, 2025
c4a0f5c
some clean up of op sum
bettinaheim Jan 28, 2025
b7c332b
some clean up for products
bettinaheim Jan 28, 2025
40b6831
no type constraints for HandlerTy
bettinaheim Jan 29, 2025
7e0ff7a
left hand arithmetics cleanup
bettinaheim Jan 29, 2025
7326070
more clean up
bettinaheim Jan 29, 2025
01e06d6
more clean up
bettinaheim Jan 29, 2025
ec5d65f
more clean up
bettinaheim Jan 29, 2025
1d06e8f
finished cleanup of arithmetics
bettinaheim Jan 29, 2025
f5511dd
picking up Anthony's changes
bettinaheim Jan 30, 2025
28be4e2
just a quick renaming
bettinaheim Jan 30, 2025
0a606cc
minor thing
bettinaheim Jan 30, 2025
51dff46
minor thing
bettinaheim Jan 30, 2025
007315a
minor things
bettinaheim Jan 31, 2025
6d2aa4c
enabling a whole bunch of additional tests
bettinaheim Jan 31, 2025
a567501
some more product op fixes
bettinaheim Feb 3, 2025
70798ff
just some test fixes
bettinaheim Feb 3, 2025
fdec675
fixing matrix reordering issues
bettinaheim Feb 3, 2025
568660d
enabling the rest of the tests
bettinaheim Feb 3, 2025
5caa5ca
completing tests, including for custom matrices
bettinaheim Feb 4, 2025
d81a384
minor clean up
bettinaheim Feb 4, 2025
558b249
general clean up
bettinaheim Feb 4, 2025
614329e
clean up (moving some files)
bettinaheim Feb 5, 2025
4f132ab
prep for adding different handlers
bettinaheim Feb 5, 2025
f0d4a53
trivial spin ops to set up tests before digging into perf optimizations
bettinaheim Feb 5, 2025
75fe168
some more tests, and making dimensions not required for evaluation if…
bettinaheim Feb 5, 2025
a62bc65
more spin ops tests
bettinaheim Feb 6, 2025
e75a991
commit before removing inheritance
bettinaheim Feb 7, 2025
bf45d72
removing the inheritance from operator sum
bettinaheim Feb 7, 2025
c3335a7
some more clean up
bettinaheim Feb 7, 2025
4ced904
implementing remaining conversions
bettinaheim Feb 10, 2025
0f471ef
finished conversion tests
bettinaheim Feb 10, 2025
da6f807
gathering some perf numbers before optimization
bettinaheim Feb 10, 2025
bf7a1a1
always link the operator lib
bettinaheim Feb 10, 2025
595ecb1
undoing accidentally committed change
bettinaheim Feb 10, 2025
0cf5b60
product optimizations
bettinaheim Feb 10, 2025
9df12ab
first version with perf improvements
bettinaheim Feb 13, 2025
9f60c85
perf version 2 with map
bettinaheim Feb 13, 2025
12f68c5
changes to the test script
bettinaheim Feb 13, 2025
ebae7cb
checking in v2 perf numbers for comparison
bettinaheim Feb 14, 2025
8bf96ae
some rvalue overloads for v2
bettinaheim Feb 14, 2025
72fea22
commit before switching branches
bettinaheim Feb 14, 2025
cfaa651
third and final version with a decent performance across the board
bettinaheim Feb 17, 2025
b0ec707
adding missing rvalue overloads
bettinaheim Feb 17, 2025
6414321
getting updates from main
bettinaheim Feb 18, 2025
8872f50
removing some files that should not be part of this PR
bettinaheim Feb 18, 2025
5941450
forgot one file
bettinaheim Feb 18, 2025
ef4ecf7
forgot one file
bettinaheim Feb 18, 2025
c89dff4
just some clean up
bettinaheim Feb 18, 2025
7d591e0
just some clean up
bettinaheim Feb 18, 2025
5f2c47e
full in-place multiplication for bosons
bettinaheim Feb 19, 2025
84459cc
additional boson tests and clean up
bettinaheim Feb 19, 2025
dbd5f5a
[wip] preparing to add fermion operators
bettinaheim Feb 20, 2025
813076e
[wip] - commit before deciding to change the representation
bettinaheim Feb 21, 2025
ec33bc1
fermion on a single degree - tests may need to be updated once we mak…
bettinaheim Feb 21, 2025
e127967
do not reorder terms for fermions - should take care of antisymmetry,…
bettinaheim Feb 21, 2025
fe1b45f
commit before moving the operator arithmetics into the header...
bettinaheim Feb 24, 2025
1f3a56d
first draft for spin ops to matrix opt - needs clean up
bettinaheim Feb 24, 2025
adbb61d
minor things
bettinaheim Feb 24, 2025
add37ac
some clean up and more tests
bettinaheim Feb 25, 2025
fea18d2
some clean up
bettinaheim Feb 25, 2025
629e2ae
making internal (canonical) ordering and user facing ordering constan…
bettinaheim Feb 25, 2025
dedb249
clean up and a test
bettinaheim Feb 25, 2025
483fc90
less copying during evaluation
bettinaheim Feb 25, 2025
dca2130
trivial implementation of anti-commutation relations (needs clean up)
bettinaheim Feb 26, 2025
573b7fa
simplifying fermion operator handler since we don't use negative op c…
bettinaheim Feb 26, 2025
67385c4
test boson commutation relation
bettinaheim Feb 26, 2025
b478b0f
introducing a more general notion of 'commutation sets'
bettinaheim Feb 26, 2025
b0c8be1
template specialization to avoid unnecessary overhead and some explan…
bettinaheim Feb 26, 2025
c7f2fc1
properly allowing to customize commutation behavior - should allow fo…
bettinaheim Feb 27, 2025
ff32122
review comments
bettinaheim Feb 27, 2025
dcb810d
formatting
bettinaheim Feb 27, 2025
1fcbfb5
adding a quick check that fermion commutation relation with number op…
bettinaheim Feb 27, 2025
486fccb
formatting
bettinaheim Feb 27, 2025
c1844af
spelling
bettinaheim Feb 27, 2025
f90f011
one more formatting fix
bettinaheim Feb 27, 2025
2753009
Merge branch 'main' into operators
bettinaheim Feb 28, 2025
d59ca05
cleaning up scalars
bettinaheim Feb 28, 2025
f964a4a
fixing some warning
bettinaheim Feb 28, 2025
4d6e9a4
cleaning up the messy complex constants
bettinaheim Feb 28, 2025
0b30bf3
Merge branch 'main' into operators
bettinaheim Feb 28, 2025
97eecc2
DCO Remediation Commit for Bettina Heim <heimb@outlook.com>
bettinaheim Feb 28, 2025
cfe341e
missed one
bettinaheim Feb 28, 2025
a9d1eb2
Merge branch 'operators' of https://github.com/bettinaheim/cuda-quant…
bettinaheim Feb 28, 2025
fb71af3
fixing some warnings
bettinaheim Feb 28, 2025
20b7385
removing some explicit template instantiations
bettinaheim Feb 28, 2025
49720c9
see if this makes both compilers happy
bettinaheim Feb 28, 2025
659e55a
Merge branch 'main' into operators
bettinaheim Feb 28, 2025
56f6405
formatting
bettinaheim Feb 28, 2025
612b9ab
fixing typo in build script
bettinaheim Feb 28, 2025
b6cfd94
more minor fixes to make different compilers happy
bettinaheim Feb 28, 2025
fe5be48
Merge branch 'main' into operators
bettinaheim Feb 28, 2025
c3e9831
Merge branch 'main' into operators
bettinaheim Mar 1, 2025
a144626
sorts out the template instantiation for clang
bettinaheim Mar 1, 2025
56c2b07
Merge branch 'operators' of https://github.com/bettinaheim/cuda-quant…
bettinaheim Mar 1, 2025
300e477
fixing one more missing instantiation
bettinaheim Mar 1, 2025
bd60bd8
fixing the tensor exponential
bettinaheim Mar 1, 2025
9e6d1e7
going with any throws so the tests can also run in the assets build
bettinaheim Mar 1, 2025
68b915b
expect near for double comparison
bettinaheim Mar 2, 2025
628a1ec
Merge branch 'main' into operators
bettinaheim Mar 2, 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
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
"C_Cpp.inlayHints.referenceOperator.enabled": false,
"C_Cpp.doxygen.generateOnType": false,
"C_Cpp.default.cStandard": "c17",
"C_Cpp.default.cppStandard": "c++20",
"C_Cpp.default.cppStandard": "c++17",
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"C_Cpp.default.compileCommands": "${workspaceFolder}/build/compile_commands.json",
"C_Cpp.default.includePath": [
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/config/spelling_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ discoverable
discretization
discretize
discretized
eigenbasis
eigensolver
eigensolvers
eigenstate
Expand All @@ -202,6 +203,7 @@ eigenvalues
eigenvector
eigenvectors
endian
endianness
enqueue
enqueues
enqueuing
Expand Down
1 change: 1 addition & 0 deletions cmake/Modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ set(CONFIG_FILES
CUDAQEmDefaultConfig.cmake
CUDAQNloptConfig.cmake
CUDAQSpinConfig.cmake
CUDAQOperatorConfig.cmake
CUDAQConfig.cmake
CUDAQEnsmallenConfig.cmake
CUDAQPlatformDefaultConfig.cmake
Expand Down
3 changes: 3 additions & 0 deletions cmake/Modules/CUDAQConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ list(APPEND CMAKE_MODULE_PATH "${CUDAQ_CMAKE_DIR}")
set (CUDAQSpin_DIR "${CUDAQ_CMAKE_DIR}")
find_dependency(CUDAQSpin REQUIRED)

set (CUDAQOperator_DIR "${CUDAQ_CMAKE_DIR}")
find_dependency(CUDAQOperator REQUIRED)

set (CUDAQCommon_DIR "${CUDAQ_CMAKE_DIR}")
find_dependency(CUDAQCommon REQUIRED)

Expand Down
3 changes: 3 additions & 0 deletions cmake/Modules/CUDAQEmDefaultConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ get_filename_component(CUDAQ_EM_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set (CUDAQSpin_DIR "${CUDAQ_EM_CMAKE_DIR}")
find_dependency(CUDAQSpin REQUIRED)

set (CUDAQOperator_DIR "${CUDAQ_EM_CMAKE_DIR}")
find_dependency(CUDAQOperator REQUIRED)

set (CUDAQCommon_DIR "${CUDAQ_EM_CMAKE_DIR}")
find_dependency(CUDAQCommon REQUIRED)

Expand Down
13 changes: 13 additions & 0 deletions cmake/Modules/CUDAQOperatorConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# ============================================================================ #
# Copyright (c) 2022 - 2025 NVIDIA Corporation & Affiliates. #
# All rights reserved. #
# #
# This source code and the accompanying materials are made available under #
# the terms of the Apache License 2.0 which accompanies this distribution. #
# ============================================================================ #

get_filename_component(CUDAQ_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)

if(NOT TARGET cudaq::cudaq-operator)
include("${CUDAQ_CMAKE_DIR}/CUDAQOperatorTargets.cmake")
endif()
3 changes: 3 additions & 0 deletions cmake/Modules/CUDAQPlatformDefaultConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ get_filename_component(CUDAQ_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set (CUDAQEmDefault_DIR "${CUDAQ_CMAKE_DIR}")
find_dependency(CUDAQEmDefault REQUIRED)

set (CUDAQOperator_DIR "${CUDAQ_CMAKE_DIR}")
find_dependency(CUDAQOperator REQUIRED)

set (CUDAQSpin_DIR "${CUDAQ_CMAKE_DIR}")
find_dependency(CUDAQSpin REQUIRED)

Expand Down
1 change: 1 addition & 0 deletions cmake/Modules/NVQIRConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ include(CMakeFindDependencyMacro)
get_filename_component(PARENT_DIRECTORY ${NVQIR_CMAKE_DIR} DIRECTORY)

find_dependency(CUDAQSpin REQUIRED HINTS "${PARENT_DIRECTORY}/cudaq")
find_dependency(CUDAQOperator REQUIRED HINTS "${PARENT_DIRECTORY}/cudaq")
find_dependency(CUDAQCommon REQUIRED HINTS "${PARENT_DIRECTORY}/cudaq")
find_package(fmt QUIET)
if (NOT fmt_FOUND)
Expand Down
2 changes: 1 addition & 1 deletion python/cudaq/operator/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


# Operators as defined here (watch out of differences in convention):
# https://www.dynamiqs.org/python_api/utils/operators/sigmay.html
# https://www.dynamiqs.org/stable/python_api/utils/operators/create.html
class operators:

class matrices:
Expand Down
5 changes: 3 additions & 2 deletions runtime/cudaq/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if (CUDA_FOUND)
PRIVATE .)

target_link_libraries(${LIBRARY_NAME}
PUBLIC dl cudaq-spin cudaq-common cudaq-nlopt cudaq-ensmallen
PUBLIC dl cudaq-spin cudaq-operator cudaq-common cudaq-nlopt cudaq-ensmallen
PRIVATE nvqir fmt::fmt-header-only CUDA::cudart_static)

target_compile_definitions(${LIBRARY_NAME} PRIVATE CUDAQ_HAS_CUDA)
Expand All @@ -52,7 +52,7 @@ else()
PRIVATE .)

target_link_libraries(${LIBRARY_NAME}
PUBLIC dl cudaq-spin cudaq-common cudaq-nlopt cudaq-ensmallen
PUBLIC dl cudaq-spin cudaq-operator cudaq-common cudaq-nlopt cudaq-ensmallen
PRIVATE nvqir fmt::fmt-header-only)
endif()

Expand All @@ -61,6 +61,7 @@ add_subdirectory(algorithms)
add_subdirectory(platform)
add_subdirectory(builder)
add_subdirectory(domains)
add_subdirectory(dynamics)

install(TARGETS ${LIBRARY_NAME} EXPORT cudaq-targets DESTINATION lib)

Expand Down
49 changes: 49 additions & 0 deletions runtime/cudaq/dynamics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# ============================================================================ #
# Copyright (c) 2022 - 2025 NVIDIA Corporation & Affiliates. #
# All rights reserved. #
# #
# This source code and the accompanying materials are made available under #
# the terms of the Apache License 2.0 which accompanies this distribution. #
# ============================================================================ #

set(LIBRARY_NAME cudaq-operator)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-ctad-maybe-unsupported")
set(INTERFACE_POSITION_INDEPENDENT_CODE ON)

set(CUDAQ_OPS_SRC
callback.cpp
scalar_operators.cpp
spin_operators.cpp
boson_operators.cpp
fermion_operators.cpp
matrix_operators.cpp
product_operators.cpp
operator_sum.cpp
handler.cpp
schedule.cpp
helpers.cpp
)

add_library(${LIBRARY_NAME} SHARED ${CUDAQ_OPS_SRC})
set_property(GLOBAL APPEND PROPERTY CUDAQ_RUNTIME_LIBS ${LIBRARY_NAME})
target_compile_definitions(${LIBRARY_NAME} PRIVATE -DCUDAQ_INSTANTIATE_TEMPLATES)

target_include_directories(${LIBRARY_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/runtime>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/tpls/eigen>
$<INSTALL_INTERFACE:include>
PRIVATE .)

set (OPERATOR_DEPENDENCIES "")
list(APPEND OPERATOR_DEPENDENCIES fmt::fmt-header-only)
add_openmp_configurations(${LIBRARY_NAME} OPERATOR_DEPENDENCIES)

target_link_libraries(${LIBRARY_NAME} PRIVATE ${OPERATOR_DEPENDENCIES})

install(TARGETS ${LIBRARY_NAME} EXPORT cudaq-operator-targets DESTINATION lib)

install(EXPORT cudaq-operator-targets
FILE CUDAQOperatorTargets.cmake
NAMESPACE cudaq::
DESTINATION lib/cmake/cudaq)
Loading
Loading