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

[python] Support returning complex numbers from python #1610

Conversation

annagrin
Copy link
Collaborator

@annagrin annagrin commented May 3, 2024

Description

Add the following features to Python kernel functions:

  • Support for returning complex, numpy.complex128, numpy.complex64, numpy.float64, numpy.float32 numbers.
  • Handle returning arguments from an inner scope.
  • Allow casting of list elements to complex and float types on parameter passing.
  • Add tests.

Closes: #1608

@annagrin annagrin marked this pull request as draft May 3, 2024 17:15
github-actions bot pushed a commit that referenced this pull request May 3, 2024
github-actions bot pushed a commit that referenced this pull request May 3, 2024
@annagrin annagrin changed the title Kernel complex support return [python] Support returning complex numbers from python May 6, 2024
github-actions bot pushed a commit that referenced this pull request May 6, 2024
@annagrin annagrin marked this pull request as ready for review May 7, 2024 19:17
github-actions bot pushed a commit that referenced this pull request May 7, 2024
@annagrin annagrin requested review from amccaskey and schweitzpgi May 8, 2024 22:16
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.

Looking good, Anna. A few suggestions and minor nits.

lib/Optimizer/Builder/Factory.cpp Outdated Show resolved Hide resolved
python/cudaq/kernel/kernel_decorator.py Show resolved Hide resolved
python/runtime/cudaq/platform/py_alt_launch_kernel.cpp Outdated Show resolved Hide resolved
python/utils/OpaqueArguments.h Outdated Show resolved Hide resolved
python/utils/PyTypes.h Show resolved Hide resolved
python/utils/PyTypes.h Outdated Show resolved Hide resolved
python/utils/PyTypes.h Show resolved Hide resolved
annagrin and others added 2 commits May 9, 2024 10:33
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
github-actions bot pushed a commit that referenced this pull request May 9, 2024
@annagrin annagrin requested a review from schweitzpgi May 10, 2024 21:03
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.

Looks good. Thanks, Anna.

python/utils/OpaqueArguments.h Outdated Show resolved Hide resolved
@annagrin annagrin enabled auto-merge (squash) May 13, 2024 21:44
github-actions bot pushed a commit that referenced this pull request May 13, 2024
@annagrin annagrin merged commit ed274f9 into NVIDIA:experimental/stateHandling May 14, 2024
112 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators May 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants