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

Add parser support for "extern port" and "extern frame" statements #37

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

hodgestar
Copy link
Contributor

@hodgestar hodgestar commented Jan 10, 2025

OpenPulse specifies that ports and frame may declared via "extern port" and "extern frame" statements (see https://openqasm.com/language/openpulse.html#ports and https://openqasm.com/language/openpulse.html#frames).

However OpenQASM only supports extern functions (not identifiers) so both of these statements are currently unsupported and raise parsing errors.

The OpenPulse examples also use "extern port". See https://openqasm.com/language/pulses.html#inline-calibration-blocks and https://openqasm.com/language/pulses.html#inline-calibration-blocks for relevant examples.

This merge request adds support for "extern port" and "extern frame" statements. Its intended to be a minimal parse update to match the current OpenPulse specification.

This issue was reported in openqasm/openqasm#577 and I've also encountered it myself in Zurich Instruments' OpenPulse compiler.

@hodgestar hodgestar marked this pull request as draft January 10, 2025 14:01
@hodgestar hodgestar marked this pull request as ready for review January 10, 2025 14:28
@hodgestar
Copy link
Contributor Author

I'll make a separate PR to update the tests to not require Python 3.7.

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.

1 participant