Skip to content

feat: Add float32 zero-copy angle encoding in Python bindings (single sample) - #1264

Merged
rich7420 merged 9 commits into
apache:mainfrom
viiccwen:feature/angle-f32-python-binding-single
Apr 21, 2026
Merged

feat: Add float32 zero-copy angle encoding in Python bindings (single sample)#1264
rich7420 merged 9 commits into
apache:mainfrom
viiccwen:feature/angle-f32-python-binding-single

Conversation

@viiccwen

Copy link
Copy Markdown
Contributor

Related Issues

Closes #1250

Changes

  • Bug fix
  • New feature
  • Refactoring
  • Documentation
  • Test
  • CI/CD pipeline
  • Other

Why

QDP core already supports single-sample angle encoding from CUDA float32
buffers, but the Python binding did not expose that path. This PR adds the
Python-side support while keeping batch CUDA angle inputs on float64.

How

  • route 1D CUDA float32 angle tensors through the dedicated zero-copy angle
    GPU-pointer path
  • keep CUDA angle float32 support limited to 1D single-sample tensors
  • add targeted Python tests for success and rejection paths
  • document the CUDA tensor dtype rules for amplitude and angle
  • pin the IQP naive-reference comparison test to float64 precision so the
    comparison matches the reference dtype

Checklist

  • Added or updated unit tests for all changes
  • Added or updated documentation for all changes

@viiccwen viiccwen changed the title [Feature][QDP] Add float32 zero-copy angle encoding in Python bindings (single sample) feat: Add float32 zero-copy angle encoding in Python bindings (single sample) Apr 13, 2026

@rich7420 rich7420 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for the patch! sorry for the late review:

Comment thread qdp/qdp-python/src/engine.rs Outdated
Comment thread qdp/qdp-python/src/engine.rs Outdated
@viiccwen
viiccwen force-pushed the feature/angle-f32-python-binding-single branch from 9308194 to f815e74 Compare April 20, 2026 11:22

@rich7420 rich7420 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@rich7420
rich7420 merged commit df0618a into apache:main Apr 21, 2026
8 checks passed
@ryankert01 ryankert01 added this to the Qumat 0.6.0 milestone May 13, 2026
@viiccwen
viiccwen deleted the feature/angle-f32-python-binding-single branch July 15, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add float32 zero-copy angle encoding in Python bindings (single sample)

3 participants