Skip to content

Waveform improvements#485

Open
antalsz wants to merge 33 commits into
mainfrom
waveform-improvements
Open

Waveform improvements#485
antalsz wants to merge 33 commits into
mainfrom
waveform-improvements

Conversation

@antalsz

@antalsz antalsz commented Oct 18, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@antalsz antalsz force-pushed the waveform-improvements branch from 129efe4 to 536f275 Compare October 18, 2025 16:59
@antalsz antalsz changed the base branch from main to instruction-handler-improvements October 18, 2025 16:59
Base automatically changed from instruction-handler-improvements to main January 13, 2026 23:14
@antalsz antalsz force-pushed the waveform-improvements branch from 536f275 to fc077e4 Compare January 16, 2026 03:38
@github-actions

github-actions Bot commented Jan 16, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://rigetti.github.io/quil-rs/pr-preview/pr-485/

Built to branch quil-py-docs at 2026-07-01 07:38 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Comment thread quil-rs/src/waveform/mod.rs Outdated
Comment thread quil-rs/src/waveform/mod.rs Outdated
Co-authored-by: Jessica Jeng <mingyoungjeng@gmail.com>

@asaites asaites 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.

I've made some comments, but think I need to spend a bit more time with the code first.

In general, my concern is that the abstraction level is grander than necessary for the goals, and that it makes the code particularly challenging to follow (and perhaps use and maintain).

What would help a lot for me for working out how this impacts Python users/what suggestions I can make for the PyO3 usage: could you update some or all of the Python tests that are currently broken?

Comment thread quil-rs/src/quilpy/mod.rs Outdated
Comment thread quil-rs/src/waveform/sampling.rs Outdated
Comment thread quil-rs/src/waveform/quilpy.rs Outdated
Comment thread quil-rs/src/waveform/quilpy.rs Outdated
Comment thread quil-rs/src/waveform/quilpy.rs Outdated
Comment thread quil-rs/src/waveform/sampling.rs Outdated
Samples(Vec<Complex64>),
}

impl IqSamples {

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.

As written here, this block can be #[pymethods] too, and you can avoid rewriting the wrapper functions. For Python users, it would benefit from a Sequence implementation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I couldn't figure out how to implement a Python class for a pyo3 type (assuming you're referring to collections.abc.Sequence). Any guidance would be appreciated!

Comment thread quil-rs/src/waveform/builtin.rs Outdated
Comment thread quil-rs/src/waveform/quilpy.rs Outdated
Comment thread quil-rs/src/waveform/quilpy.rs Outdated
@antalsz antalsz marked this pull request as ready for review April 9, 2026 06:55
@windsurf-bot

windsurf-bot Bot commented Apr 9, 2026

Copy link
Copy Markdown

I ran into an unexpected issue while reviewing this PR. Please try again later.

@asaites asaites 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 hard work here; I really appreciate the documentation changes and the comprehensive the Python tests. I do have a couple of minor comments on a few things that are more style than substance, I think.

I'm going to look into what's up with CI right now, as there are a lot of failures. I think they may require some customization to the bindings' linter to handle the macros you've added.

Comment thread quil-rs/src/waveform/builtin.rs Outdated
Comment thread quil-rs/src/waveform/builtin.rs Outdated
Comment thread quil-rs/src/waveform/quilpy.rs Outdated
Comment on lines +70 to +71
// U+005B is `[` (i.e., LEFT SQUARE BRACKET), but we have to hide it with an escape so as
// not to confuse our homegrown PyO3 linter script (`quil-rs/scripts/lint-quil-rs.py`).

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.

😮‍💨

Comment thread quil-rs/tests_py/test_waveforms.py Outdated
Comment thread quil-rs/src/waveform/quilpy.rs Outdated
@asaites

asaites commented May 6, 2026

Copy link
Copy Markdown
Contributor

I pushed a couple commits to this branch to address the CI failures related to linting issues.

Mostly, they were false positives: the new waveform macros generating classes, so the linter needed to be taught how to interpret the macro invocation to connect it to the exported classes.

There was one legitimate issue: IqSamples is a "complex enum" class, so we want to apply a fix to it to ensure it can be pickled. That's as easy as moving it to the complex_enums section of create_init_submodule.

It looks like there's a new cargo-deny issue, though 🙄 .

@antalsz

antalsz commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

The cargo-deny is trivially fixable by updating rand (either to a semver-compatible release or to a future version of the crate, so it's easy) – I'll do that when I apply the other changes. Also, @mingyoungjeng has suggested some API improvements to this code that I want to apply before we merge this.

@antalsz antalsz left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Here are some comments I meant to submit a while ago but they got trapped in "pending"

Comment thread quil-rs/src/waveform/builtin.rs Outdated
Comment thread quil-rs/tests_py/test_waveforms.py Outdated
@antalsz antalsz force-pushed the waveform-improvements branch from 4074d24 to 79a8d3c Compare June 28, 2026 20:56
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.

3 participants