-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First pass of support for C++ operators #2511
Open
anthony-santana
wants to merge
54
commits into
NVIDIA:experimental/operators
Choose a base branch
from
sacpis:dynamics_cpp_operators
base: experimental/operators
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
First pass of support for C++ operators #2511
anthony-santana
wants to merge
54
commits into
NVIDIA:experimental/operators
from
sacpis:dynamics_cpp_operators
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR fixes an LLVM discrepancy in our Docker images vs our Python wheels. This should fix NVIDIA#1421 and NVIDIA#1799 for our Python wheels. (The Docker images were already correct.)
* Docs for trajectory simulation Signed-off-by: Thien Nguyen <[email protected]> * Fix spelling and code format Signed-off-by: Thien Nguyen <[email protected]> * Update mgpu hash: include fixes for 2434 Signed-off-by: Thien Nguyen <[email protected]> * Update docs/sphinx/snippets/cpp/using/backends/trajectory.cpp Co-authored-by: Eric Schweitz <[email protected]> Signed-off-by: Thien Nguyen <[email protected]> * Update docs/sphinx/snippets/cpp/using/backends/trajectory.cpp Co-authored-by: Eric Schweitz <[email protected]> Signed-off-by: Thien Nguyen <[email protected]> * Update docs/sphinx/snippets/cpp/using/backends/trajectory_observe.cpp Co-authored-by: Eric Schweitz <[email protected]> Signed-off-by: Thien Nguyen <[email protected]> * Update docs/sphinx/snippets/cpp/using/backends/trajectory_observe.cpp Co-authored-by: Eric Schweitz <[email protected]> Signed-off-by: Thien Nguyen <[email protected]> * Update python/cudaq/runtime/observe.py Co-authored-by: Eric Schweitz <[email protected]> Signed-off-by: Thien Nguyen <[email protected]> --------- Signed-off-by: Thien Nguyen <[email protected]> Signed-off-by: Thien Nguyen <[email protected]> Co-authored-by: Eric Schweitz <[email protected]>
For small controlled ops, i.e., singly controlled, expand the gate matrix and use cutensornetStateApplyTensorOperator. Add CUDAQ_TENSORNET_CONTROLLED_RANK threshold to determine when cutensornetStateApplyControlledTensorOperator is used. For MPS, this is fixed at 1 as it cannot handle gate ops with more than 2 qubits. Add doc for the setting and also remove some stale notes about random seeds in the docs. Signed-off-by: Thien Nguyen <[email protected]>
sacpis
approved these changes
Jan 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if all tests are running successfully.
sacpis
force-pushed
the
dynamics_cpp_operators
branch
from
January 16, 2025 22:10
2b42628
to
8150d70
Compare
sacpis
requested review from
1tnguyen,
bmhowe23 and
schweitzpgi
as code owners
January 16, 2025 22:10
…de (NVIDIA#2516) * Fix a bug in default init of scratchpad: it must allocate memory after we've set the device Signed-off-by: Thien Nguyen <[email protected]> * Add test Signed-off-by: Thien Nguyen <[email protected]> * Add a check to prevent multiple allocate calls Signed-off-by: Thien Nguyen <[email protected]> --------- Signed-off-by: Thien Nguyen <[email protected]>
Signed-off-by: Pradnya Khalate <[email protected]>
…#2519) Signed-off-by: Ben Howe <[email protected]>
sacpis
force-pushed
the
dynamics_cpp_operators
branch
from
January 21, 2025 17:11
752fed1
to
d55814d
Compare
* Fix the behavior of `quera` backend with C++ frontend by showing appropriate error message. (Behavior prior to this change - default simulator was invoked) * Tell nvq++ to generate glue for `quera` * Simplify libraries - combine 'libcudaq-quera-qpu.so' and 'libcudaq-serverhelper-quera.so' into one. Signed-off-by: Pradnya Khalate <[email protected]>
Changes: - cuda-quantum/cuquantum-mgpu!36: fix a bug in trajectory simulation - cuda-quantum/cuquantum-mgpu!37: fix a bug in applyExpPauli: invalid value errors when the pauli word is acting on a subset of qubits. Signed-off-by: Thien Nguyen <[email protected]>
sacpis
force-pushed
the
dynamics_cpp_operators
branch
from
January 23, 2025 17:42
0ebeed5
to
b592f8a
Compare
* Upgrading notebook version to 7.3.2 from 7.1.3 Signed-off-by: Sachin Pisal <[email protected]> * updating jupyterlab version to 4.3.4 Signed-off-by: Sachin Pisal <[email protected]> --------- Signed-off-by: Sachin Pisal <[email protected]>
…n conditionally (NVIDIA#2532) Signed-off-by: Pradnya Khalate <[email protected]>
* [WIP] dynamics mgmn Signed-off-by: Thien Nguyen <[email protected]> * Fix a copy and paste error Signed-off-by: Thien Nguyen <[email protected]> * Handle initial state enum Signed-off-by: Thien Nguyen <[email protected]> * Update initial state enum example Signed-off-by: Thien Nguyen <[email protected]> * Add uniform state init Signed-off-by: Thien Nguyen <[email protected]> * Add uniform state init Signed-off-by: Thien Nguyen <[email protected]> * Update examples Signed-off-by: Thien Nguyen <[email protected]> * Code format Signed-off-by: Thien Nguyen <[email protected]> * Spelling Signed-off-by: Thien Nguyen <[email protected]> * Add more MPI API to CUDAQ comm plugin interface Signed-off-by: Thien Nguyen <[email protected]> * Refactor for dependency isolation Signed-off-by: Thien Nguyen <[email protected]> * Code format Signed-off-by: Thien Nguyen <[email protected]> * More isolation Signed-off-by: Thien Nguyen <[email protected]> * connect cuda-q mpi plugin to cudensitymat Signed-off-by: Thien Nguyen <[email protected]> * Fix for CI Signed-off-by: Thien Nguyen <[email protected]> * Code format: python Signed-off-by: Thien Nguyen <[email protected]> * Support initial state enum for non-dynamics case and add test Signed-off-by: Thien Nguyen <[email protected]> * Code tidy up and add docs Signed-off-by: Thien Nguyen <[email protected]> * Add MPI tests Signed-off-by: Thien Nguyen <[email protected]> * Add a link to the example directory Signed-off-by: Thien Nguyen <[email protected]> * Fix a typo Signed-off-by: Thien Nguyen <[email protected]> * Address CR: docs and comments edits; refactor to reduce code duplicate Signed-off-by: Thien Nguyen <[email protected]> --------- Signed-off-by: Thien Nguyen <[email protected]>
* Add non path reuse option Signed-off-by: Thien Nguyen <[email protected]> * Add docs and test Signed-off-by: Thien Nguyen <[email protected]> * Code review: add a note about observe with tensornet and update code comments Signed-off-by: Thien Nguyen <[email protected]> --------- Signed-off-by: Thien Nguyen <[email protected]>
Signed-off-by: Ben Howe <[email protected]>
sacpis
force-pushed
the
dynamics_cpp_operators
branch
from
January 25, 2025 19:57
97bd0d6
to
3f00f9f
Compare
Signed-off-by: Pradnya Khalate <[email protected]>
…)" (NVIDIA#2548) This reverts commit 5ee448d. Since nv-gha-runners/vm-images#113 has been merged, we can revert our temporary change. Signed-off-by: Ben Howe <[email protected]>
Signed-off-by: Ben Howe <[email protected]>
sacpis
force-pushed
the
dynamics_cpp_operators
branch
from
January 28, 2025 00:12
bbec3ed
to
5b14fad
Compare
Signed-off-by: Sachin Pisal <[email protected]>
Signed-off-by: Sachin Pisal <[email protected]>
Signed-off-by: Sachin Pisal <[email protected]>
* Removing base_operator class, as operator_sum will act as a base class Signed-off-by: Sachin Pisal <[email protected]>
* Aggregating parameters * Extracting documentation * Extracting positional and keyword arguments * Generating all quantum states for given degrees and dimensions * Permuting a given matrix * Canonicalizing degrees * Adding test cases for the above functions * Formatting Signed-off-by: Sachin Pisal <[email protected]>
Signed-off-by: Sachin Pisal <[email protected]>
Signed-off-by: Sachin Pisal <[email protected]>
Signed-off-by: Sachin Pisal <[email protected]>
Signed-off-by: Sachin Pisal <[email protected]>
* Adding unitests for Rydberg hamiltonian operator * Making evaluate function in scalar_operator const Signed-off-by: Sachin Pisal <[email protected]>
Signed-off-by: Sachin Pisal <[email protected]>
Signed-off-by: Sachin Pisal <[email protected]>
Signed-off-by: Sachin Pisal <[email protected]>
Signed-off-by: Sachin Pisal <[email protected]>
* Using CUDA_C_64F data type for complex Signed-off-by: Sachin Pisal <[email protected]>
Signed-off-by: Sachin Pisal <[email protected]>
Signed-off-by: Sachin Pisal <[email protected]>
Signed-off-by: Sachin Pisal <[email protected]>
the cudensitymatElementaryOperator_t * Fetching subspace_extents using elementary_op degrees * Adding a vector with correct action duality Signed-off-by: Sachin Pisal <[email protected]>
Signed-off-by: Sachin Pisal <[email protected]>
…apart for temp vector Signed-off-by: Sachin Pisal <[email protected]>
Signed-off-by: Sachin Pisal <[email protected]>
Signed-off-by: Sachin Pisal <[email protected]>
…n InitialStateArgT Signed-off-by: Sachin Pisal <[email protected]>
Signed-off-by: Sachin Pisal <[email protected]>
* Adding create_initial_state method to create initial state based on the passed InitialStateArgT Signed-off-by: Sachin Pisal <[email protected]>
Signed-off-by: Sachin Pisal <[email protected]>
Signed-off-by: Sachin Pisal <[email protected]>
Signed-off-by: Sachin Pisal <[email protected]>
sacpis
force-pushed
the
dynamics_cpp_operators
branch
from
January 30, 2025 00:01
5169445
to
337fa80
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is an initial commit to the experimental branch containing a first pass of work towards operator support in C++