Skip to content

Qasm3 parametric circuit - #152

Closed
Mayank Goel (Mayank447) wants to merge 10 commits into
Qiskit:mainfrom
Mayank447:qasm3-parametric-circuit
Closed

Mayank Goel (Mayank447) wants to merge 10 commits into
Qiskit:mainfrom
Mayank447:qasm3-parametric-circuit

Conversation

@Mayank447

@Mayank447 Mayank Goel (Mayank447) commented Jun 5, 2026 •

Copy link
Copy Markdown

Summary

Allow Qiskit C++ to export qasm3 for parametrized circuits. As a suggestion it might be better to add a C-API extension to get all the circuit parameters (currently there is only an API to get number of parameters).

Details and comments

Essentially to_qasm3 method has been moved to a different file and linked to Circuit class via the implementation header file. The only major change is in to print the parameters declaration after include stdgates.inc; as per QASM3 standard.

Note: The implementation is mine but the tests were generated by Opus 4.6. I have verified the generated tests but its betters to properly review them for any edge case I missed.

  • I have added the tests to cover my changes.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.

Fixes #146

@Mayank447
Mayank Goel (Mayank447) force-pushed the qasm3-parametric-circuit branch 2 times, most recently from f004539 to 8495cdb Compare June 5, 2026 07:23
@Mayank447

Copy link
Copy Markdown
Author

Jun Doi (@doichanj) I have implemented the stab function to get the parameter symbols. Please take a look.

@1ucian0

Copy link
Copy Markdown
Member

Closing in favor of #159

Thanks Mayank Goel (@Mayank447) for the contribution anyway! If you would like to work on another issue, take a look at https://qisk.it/good-first-issues for a list of newcomer-friendly issues.

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.

QASM3 exporter with parameterized circuit support

2 participants