Skip to content

Qasm3 parametric circuit#152

Open
Mayank447 wants to merge 7 commits into
Qiskit:mainfrom
Mayank447:qasm3-parametric-circuit
Open

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

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 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
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