Skip to content

Commit 0956a1d

Browse files
committed
Improve QASM3 parameter export API
1 parent bb4ec2c commit 0956a1d

4 files changed

Lines changed: 560 additions & 39 deletions

File tree

releasenotes/notes/qasm3-exporter-parameter-146.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ features:
77
`QuantumCircuit::to_qasm3()` and `Qiskit::qasm3::dumps(circuit)` use
88
`QuantumCircuit::parameter_symbols()` to emit original parameter symbol
99
names by default. `Qiskit::qasm3::dumps(circuit, parameter_names)` remains
10-
available for callers that need to provide names explicitly.
10+
available for callers that need to provide names explicitly. Explicit
11+
parameter names must be valid OpenQASM identifiers and must not conflict
12+
with reserved OpenQASM or standard-gate identifiers.
1113
12-
Until Qiskit C exposes parameter UUIDs to C++, circuits cannot contain
13-
distinct `Parameter` objects with the same symbol name.
14+
`QuantumCircuit::parameter_symbols()` currently derives names from
15+
instruction parameter expression strings and cross-checks the recovered
16+
count against Qiskit C. Until Qiskit C exposes canonical parameter names
17+
or UUIDs to C++, circuits cannot contain distinct `Parameter` objects with
18+
the same symbol name.

src/circuit/quantumcircuit_def.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class QuantumCircuit
109109
{
110110
static const char *function_names[] = {
111111
"abs", "acos", "asin", "atan", "conj", "conjugate", "cos",
112-
"exp", "log", "sign", "sin", "tan"
112+
"exp", "log", "sign", "sin", "sqrt", "tan"
113113
};
114114
return std::find(function_names, function_names + sizeof(function_names) / sizeof(function_names[0]), name)
115115
!= function_names + sizeof(function_names) / sizeof(function_names[0]);

0 commit comments

Comments
 (0)