Skip to content

Qasm3 parametric circuit#152

Closed
Mayank447 wants to merge 10 commits into
Qiskit:mainfrom
Mayank447:qasm3-parametric-circuit
Closed

Qasm3 parametric circuit#152
Mayank447 wants to merge 10 commits into
Qiskit:mainfrom
Mayank447:qasm3-parametric-circuit

Conversation

@Mayank447

@Mayank447 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 Mayank447 force-pushed the qasm3-parametric-circuit branch 2 times, most recently from f004539 to 8495cdb Compare June 5, 2026 07:23
@Mayank447 Mayank447 force-pushed the qasm3-parametric-circuit branch from 8495cdb to a953dc1 Compare June 5, 2026 07:31
@Mayank447 Mayank447 force-pushed the qasm3-parametric-circuit branch from 4087f44 to 2161a87 Compare June 5, 2026 08:00
@Mayank447 Mayank447 force-pushed the qasm3-parametric-circuit branch from cb0d122 to 990270c Compare June 12, 2026 12:08
@Mayank447

Copy link
Copy Markdown
Author

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

@1ucian0

1ucian0 commented Jun 16, 2026

Copy link
Copy Markdown
Member

Closing in favor of #159

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

@1ucian0 1ucian0 closed this Jun 16, 2026
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