Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions releasenotes/notes/qasm3-parameterized-export-146.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
features:
- |
Added the header-only ``Qiskit::qasm3::dumps`` API for exporting quantum
circuits as OpenQASM 3. Parameterized circuits can supply their ordered
free-parameter names so the exporter emits valid ``input float[64]``
declarations. Names must be supplied explicitly because the current
Qiskit C API exposes the number of free symbols, but cannot enumerate
their names.
upgrade:
- |
Removed ``QuantumCircuit::to_qasm3``. Include ``qasm3/exporter.hpp`` and
call ``Qiskit::qasm3::dumps(circuit)`` instead. Parameterized circuits must
additionally pass the ordered names of their free parameters.
3 changes: 2 additions & 1 deletion samples/circuit_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "circuit/quantumcircuit.hpp"
#include "circuit/library/quantum_volume.hpp"
#include "qasm3/exporter.hpp"

using namespace Qiskit::circuit;

Expand Down Expand Up @@ -71,7 +72,7 @@ int main()
circ.measure(qr, cr);

circ.draw();
std::cout << circ.to_qasm3();
std::cout << Qiskit::qasm3::dumps(circ);

return 0;
}
Expand Down
3 changes: 3 additions & 0 deletions samples/parameterized_circuit_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <cmath>

#include "circuit/quantumcircuit.hpp"
#include "qasm3/exporter.hpp"

using namespace Qiskit::circuit;

Expand All @@ -38,6 +39,8 @@ int main()

circ.measure(qr, cr);

std::cout << Qiskit::qasm3::dumps(circ, {"t"}) << std::endl;

circ.print();

circ.draw();
Expand Down
Loading