Qiskit / qiskit-qasm3-import

Importer from OpenQASM 3 to Qiskit's QuantumCircuit
https://qiskit.github.io/qiskit-qasm3-import
Apache License 2.0
15 stars 7 forks source link

Computations within gate parameters leads to Parsing Error #25

Closed mbeisel closed 3 months ago

mbeisel commented 8 months ago

When exporting circuits that contain a computation within the parameters the qasm3 import leads to errors

Example:


OPENQASM 3;
include "stdgates.inc";
input float[64] gamma0;
gate rzz_1466526231824(gamma0) _gate_q_0, _gate_q_1 {
  cx _gate_q_0, _gate_q_1;
  rz(2.0*gamma0) _gate_q_1;
  rz(0.5*gamma0) _gate_q_0;
  ...
}
...

This is problematic when different gates require different multiples of a specific parameter.

Since the qasm3 exporter enables this feature, the importer should support it too, as otherwise unexpected errors can occur.