Skip to content
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

State initialization feature and performance improvements related to state handling #1754

Merged
merged 7 commits into from
Jun 7, 2024

Conversation

schweitzpgi
Copy link
Collaborator

@schweitzpgi schweitzpgi commented Jun 3, 2024

This commit squashes all the commits on the experimental/stateHandling branch into a single "mega-commit".
These changes include the majority of the work for both #1107 and #1086.

@schweitzpgi schweitzpgi marked this pull request as draft June 3, 2024 21:54
Copy link

copy-pr-bot bot commented Jun 3, 2024

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@schweitzpgi
Copy link
Collaborator Author

schweitzpgi commented Jun 3, 2024

/ok to test

Command Bot: Processing...

Copy link

github-actions bot commented Jun 3, 2024

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

Copy link

github-actions bot commented Jun 4, 2024

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Jun 4, 2024
github-actions bot pushed a commit that referenced this pull request Jun 4, 2024
Copy link

github-actions bot commented Jun 4, 2024

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

@schweitzpgi
Copy link
Collaborator Author

schweitzpgi commented Jun 5, 2024

/ok to test

Command Bot: Processing...

@schweitzpgi
Copy link
Collaborator Author

Audit core is #1766

@schweitzpgi schweitzpgi marked this pull request as ready for review June 5, 2024 16:59
@schweitzpgi schweitzpgi added documentation Improvements or additions to documentation enhancement New feature or request language Anything related to the CUDA Quantum language specification breaking change Change breaks backwards compatibility labels Jun 5, 2024
github-actions bot pushed a commit that referenced this pull request Jun 5, 2024
Copy link

github-actions bot commented Jun 5, 2024

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

schweitzpgi and others added 4 commits June 6, 2024 06:57
This commit squashes all the commits on the experimental/stateHandling
branch into a single "mega-commit".

Please double-check that the changes here are what you expect to be
merged into main.

Add back lost conversion of StateType.

Co-authored-by: Anna Gringauze <agringauze@nvidia.com>
Co-authored-by: Thien Nguyen <58006629+1tnguyen@users.noreply.github.com>
Co-authored-by: Alex McCaskey <amccaskey@nvidia.com>
skip the trotter test. cannot synthesis this one.

Ignore builder.cpp test.
* Optimize tensornet state amplitude accessor

* Fixes for mps state init

- Don't expand the init tensors: may cause canonicalization errors.

- Add host workspace allocation just in case cutn needs it.

* Update runtime/nvqir/cutensornet/mps_simulation_state.h

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>

* Update runtime/nvqir/cutensornet/tn_simulation_state.h

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>

* Code format

* Fix Python3.8: TypeError: 'type' object is not subscriptable

* Fix a stale test: __quantum__rt__qubit_allocate_array_with_state_fpXX was renamed

---------

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
* [stateHandling] Code cleanup.

Prep for merge to main. Audited the compiler core changes and found some code cleanups.

* clang-format
annagrin and others added 2 commits June 6, 2024 06:57
* Add support for initialization of qvector from lists

* Fix formatting changes

* Support nd.array creation with dtypes and creating qvector from it

* temp

* Add automatic conversion to the simulation precision data type

* Use simluation dtype for alloca operation, add length checking for scalar lists

* Support creating nd arrays and initializing vectors. Add a vector copy if necessary

* Fixed spelling

* Remove dictionary.dic

* Support cudaq.amplitudes inside kernels

* Fixed test failures

* Updated test

* Fixed more failing tests

* Remove creating qvector of const length to be handled later

* Temp

* Try a couple of ways to get state data

* Made it work e2e for testing

* Cleanup

* Support captured cudaq states in kernels

* Added error tests for trying to create a state from incorrect precision data

* Remove unneded comments

* Use a counter ID for captured states instead of hashes

* Cleanup

* Support qalloc from state

* Use common code for captured data storage in ast_bridge

* Remove temp files

* Add trotter example

* temp

* Add trotter examples and allow passing pauli_word as argument to kernels in c++

* Cleaup

* Addressed CR comments and fixed bugs in tests

* Addressed CR Comments on Trotter examples PR

* Remove unneded functions

* Remove vector-converting MLIR code and rely on runtime instead

* Create template helpers for array conversion

* Fix python trotter tests and add helper functions for type conversion

* Cleanup

* Update runtime/nvqir/NVQIR.cpp

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>

* Use concepts to constraint the conversion data types

* Fix incorrect comment

* Update runtime/nvqir/NVQIR.cpp

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>

* Fix merge problem

* Rename size to numQubits where relevant

---------

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
@schweitzpgi
Copy link
Collaborator Author

schweitzpgi commented Jun 6, 2024

/ok to test

Command Bot: Processing...

Copy link

github-actions bot commented Jun 6, 2024

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Jun 6, 2024
Copy link
Collaborator

@annagrin annagrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python code and cpp changes for it look good to me.

Copy link
Collaborator

@amccaskey amccaskey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lots of great work here +1

@schweitzpgi schweitzpgi merged commit c0cf939 into NVIDIA:main Jun 7, 2024
125 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 7, 2024
@bettinaheim bettinaheim changed the title Merge experimental/stateHandling branch to main. State initialization feature and performance improvements related to state handling Jul 29, 2024
@bettinaheim bettinaheim removed the documentation Improvements or additions to documentation label Jul 29, 2024
@bettinaheim bettinaheim added this to the release 0.8.0 milestone Jul 29, 2024
@bettinaheim bettinaheim removed the breaking change Change breaks backwards compatibility label Aug 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request language Anything related to the CUDA Quantum language specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants