Skip to content

Conversation

@comp-phys-marc
Copy link
Contributor


Context: We would like to be able to declare inputs in QASM 3.0 and pass values for these inputs to interpret()

Description of the Change: We allow additional kwargs to be passed to from_qasm3() and interpret() which populate input variables declared in the program.

Benefits: We can parameterize circuits easily.

Possible Drawbacks: The approach does not involve a compilation step like is suggested in the OpenQASM 3.0 docs here: spec.

Related ShortCut Stories: [sc-91127]

comp-phys-marc and others added 30 commits June 2, 2025 14:46
	- pylint
	- update only after check for updating a constant
	- more general Casts
	- no special handling for Literals
	- catch no-else-return lint error
	- context initialization order
	- error types
	- helper function
	- docstring
	- ranges and index expressions
@comp-phys-marc comp-phys-marc marked this pull request as ready for review July 3, 2025 16:05
@comp-phys-marc comp-phys-marc changed the title [WIP] Inputs can be provided from python to QASM 3.0 programs Inputs can be provided from python to QASM 3.0 programs Jul 3, 2025
@codecov
Copy link

codecov bot commented Jul 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.68%. Comparing base (528bf20) to head (fc13f7f).
⚠️ Report is 444 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7651   +/-   ##
=======================================
  Coverage   99.68%   99.68%           
=======================================
  Files         543      543           
  Lines       55347    55360   +13     
=======================================
+ Hits        55173    55186   +13     
  Misses        174      174           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Base automatically changed from feature/measurement to master July 3, 2025 16:41
Copy link
Contributor

@mudit2812 mudit2812 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. One blocking comment.

@comp-phys-marc comp-phys-marc requested a review from astralcai July 14, 2025 14:17
@comp-phys-marc comp-phys-marc requested a review from albi3ro July 14, 2025 17:32
Copy link
Contributor

@astralcai astralcai left a comment

Choose a reason for hiding this comment

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

LGTM!

@comp-phys-marc comp-phys-marc enabled auto-merge July 14, 2025 17:41
@comp-phys-marc comp-phys-marc added this pull request to the merge queue Jul 14, 2025
Merged via the queue into master with commit aa409b7 Jul 14, 2025
54 checks passed
@comp-phys-marc comp-phys-marc deleted the feature/inputs branch July 14, 2025 18:45
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.

6 participants