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] qvector init from lists and arrays #1688

Merged

Conversation

annagrin
Copy link
Collaborator

@annagrin annagrin commented May 15, 2024

Description

Towards: #1086

Support qvector initialization from lists and arrays:

  • Allow using lists and arrays of data types to initialize qvector

    • As a captured value
    • Passed as a parameter to a kernel
      • NOTE: not supported for np.ndarray and np.array yet
    • Created inside kernel
  • Allow following types of initializers

    • Lists of data types below
    • np.ndarray of data types below
  • Allow following data types in initializers

    • float, np.float32, np.float64, complex, np.complex128, np.complex128
  • Support using cudaq.complex, cudaq.amplitudes

    • As captures or passed as parameters
    • Inside kernels
  • Allow casting of lists of data to the when passed as parameters to the formal type

  • Perform automatic conversion of vectors to a vector of simulation data type when needed

    • Issue a performance warning on conversion

@annagrin annagrin changed the title Qvector init from state Qvector init from lists and arrays May 15, 2024
@annagrin annagrin marked this pull request as draft May 15, 2024 23:45
@annagrin annagrin changed the title Qvector init from lists and arrays [python] qvector init from lists and arrays May 15, 2024
github-actions bot pushed a commit that referenced this pull request May 16, 2024
github-actions bot pushed a commit that referenced this pull request May 16, 2024
github-actions bot pushed a commit that referenced this pull request May 16, 2024
github-actions bot pushed a commit that referenced this pull request May 16, 2024
@annagrin annagrin marked this pull request as ready for review May 16, 2024 23:16
@annagrin annagrin requested review from amccaskey and schweitzpgi May 16, 2024 23:16
@annagrin annagrin requested a review from 1tnguyen May 16, 2024 23:16
github-actions bot pushed a commit that referenced this pull request May 17, 2024
github-actions bot pushed a commit that referenced this pull request May 17, 2024
Copy link
Collaborator

@1tnguyen 1tnguyen left a comment

Choose a reason for hiding this comment

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

👍

@annagrin annagrin merged commit 5d0ec7b into NVIDIA:experimental/stateHandling May 20, 2024
125 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators May 20, 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.

2 participants