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

Enable std::vector<T> construction within kernels #593

Merged
merged 14 commits into from
Sep 1, 2023

Conversation

amccaskey
Copy link
Collaborator

@amccaskey amccaskey commented Aug 31, 2023

Enable one to create std::vector<T> on the quantum kernel stack with compile-time-known size.

_qpu__ void testDouble() {
  cudaq::qubit q;
  std::vector<double> angle{M_PI_2, M_PI_4, 2*M_PI/40.};
  ry(angle[0], q);
  ry(angle[1], q);
  ry(angle[2], q);
}

Copy link
Collaborator

@bmhowe23 bmhowe23 left a comment

Choose a reason for hiding this comment

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

This looks like it will be nice to have.

lib/Frontend/nvqpp/ConvertExpr.cpp Outdated Show resolved Hide resolved
lib/Frontend/nvqpp/ConvertExpr.cpp Outdated Show resolved Hide resolved
test/AST-Quake/vector-ctor-initlist.cpp Outdated Show resolved Hide resolved
@github-actions
Copy link

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

github-actions bot pushed a commit that referenced this pull request Aug 31, 2023
lib/Frontend/nvqpp/ConvertExpr.cpp Outdated Show resolved Hide resolved
lib/Frontend/nvqpp/ConvertExpr.cpp Outdated Show resolved Hide resolved
lib/Frontend/nvqpp/ConvertExpr.cpp Outdated Show resolved Hide resolved
lib/Frontend/nvqpp/ConvertExpr.cpp Outdated Show resolved Hide resolved
lib/Frontend/nvqpp/ConvertExpr.cpp Outdated Show resolved Hide resolved
test/AST-Quake/vector-ctor-initlist.cpp Outdated Show resolved Hide resolved
test/AST-Quake/vector-ctor-sized.cpp Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Sep 1, 2023

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

github-actions bot pushed a commit that referenced this pull request Sep 1, 2023
@amccaskey amccaskey changed the title Enable std::vector<T> construction within kernels for T = [integer, floating point] Enable std::vector<T> construction within kernels Sep 1, 2023
@github-actions
Copy link

github-actions bot commented Sep 1, 2023

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

github-actions bot pushed a commit that referenced this pull request Sep 1, 2023
@github-actions
Copy link

github-actions bot commented Sep 1, 2023

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

github-actions bot pushed a commit that referenced this pull request Sep 1, 2023
Signed-off-by: Alex McCaskey <amccaskey@nvidia.com>
…init

Signed-off-by: Alex McCaskey <amccaskey@nvidia.com>
Signed-off-by: Alex McCaskey <amccaskey@nvidia.com>
Signed-off-by: Alex McCaskey <amccaskey@nvidia.com>
Signed-off-by: Alex McCaskey <amccaskey@nvidia.com>
Signed-off-by: Alex McCaskey <amccaskey@nvidia.com>
Signed-off-by: Alex McCaskey <amccaskey@nvidia.com>
Signed-off-by: Alex McCaskey <amccaskey@nvidia.com>
Signed-off-by: Alex McCaskey <amccaskey@nvidia.com>
Signed-off-by: Alex McCaskey <amccaskey@nvidia.com>
Signed-off-by: Alex McCaskey <amccaskey@nvidia.com>
Signed-off-by: Alex McCaskey <amccaskey@nvidia.com>
Signed-off-by: Alex McCaskey <amccaskey@nvidia.com>
Signed-off-by: Alex McCaskey <amccaskey@nvidia.com>
@amccaskey amccaskey enabled auto-merge (squash) September 1, 2023 16:37
Copy link
Collaborator

@schweitzpgi schweitzpgi left a comment

Choose a reason for hiding this comment

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

+1

@amccaskey amccaskey merged commit e3795fc into NVIDIA:main Sep 1, 2023
100 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 1, 2023
@bettinaheim bettinaheim added this to the release 0.4.1 milestone Sep 27, 2023
@bettinaheim bettinaheim added the enhancement New feature or request label Sep 27, 2023
@amccaskey amccaskey deleted the vecCtorInitList branch February 29, 2024 20:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants