Skip to content

Export Parametrized Circuits to QASM3#151

Closed
Mayank447 wants to merge 0 commit into
Qiskit:mainfrom
Mayank447:main
Closed

Export Parametrized Circuits to QASM3#151
Mayank447 wants to merge 0 commit into
Qiskit:mainfrom
Mayank447:main

Conversation

@Mayank447
Copy link
Copy Markdown

@Mayank447 Mayank447 commented Jun 5, 2026

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.

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

Fixes #146

Edit: My default autoformatter in VSCode made formatting changes unrelated to mine which made the diff quite large. So closing this PR and redoing the changes in #152

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jun 5, 2026

CLA assistant check
All committers have signed the CLA.

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