Qiskit/qiskit-qasm3-import

Computations within gate parameters leads to Parsing Error

Closed this issue · 0 comments

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.