You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we export to qasm a circuit with a subcircuit with an ECRGate and the inverse of this subcircuit, then we get a qasm which has an invilid order of the gate definition: ecr_dg comes before the the definition of rzx it uses.
Calling the conversion back to circuit gives the error QasmError: "Cannot find gate definition for 'rzx', line 3 file "
qc=QuantumCircuit.from_qasm_str(qc.qasm())
What should happen?
The QASM exporter should have given a qasm where the simpler gates (i.e. rzx) are defined before being used by more complex ones (i.e. ecr_dg).
Any suggestions?
Although there are already a couple of issues on handling exotic gates during QASM exporter (#7335 and #7749), this seems a bit different because those are related to the fact that sometimes the gate definitions are hardcoded with parameters, making them less reusable and sometimes prone to errors (e.g. #7749).
In this case the order is wrong: a complex gate is declare before its subcomponent.
An option could be adding a general post processing step before outputting the qasm, that scans the definition of gates and makes sure that they are in the right order.
Anyway, regardless of the addition of this further check, I am looking for a confirmation that this manifestation of bug has the same root cause that the #7624 is addressing, so that this issue can be closed and used for a test case of that improvement.
Looking forward to hearing your feedback on this situation, thanks in advance
The text was updated successfully, but these errors were encountered:
Environment
What is happening?
If we export to qasm a circuit with a subcircuit with an ECRGate and the inverse of this subcircuit, then we get a qasm which has an invilid order of the gate definition:
ecr_dg
comes before the the definition ofrzx
it uses.How can we reproduce the issue?
Run this program:
Output:
Calling the conversion back to circuit gives the error
QasmError: "Cannot find gate definition for 'rzx', line 3 file "
What should happen?
The QASM exporter should have given a qasm where the simpler gates (i.e. rzx) are defined before being used by more complex ones (i.e. ecr_dg).
Any suggestions?
Although there are already a couple of issues on handling exotic gates during QASM exporter (#7335 and #7749), this seems a bit different because those are related to the fact that sometimes the gate definitions are hardcoded with parameters, making them less reusable and sometimes prone to errors (e.g. #7749).
In this case the order is wrong: a complex gate is declare before its subcomponent.
An option could be adding a general post processing step before outputting the qasm, that scans the definition of gates and makes sure that they are in the right order.
Anyway, regardless of the addition of this further check, I am looking for a confirmation that this manifestation of bug has the same root cause that the #7624 is addressing, so that this issue can be closed and used for a test case of that improvement.
Looking forward to hearing your feedback on this situation, thanks in advance
The text was updated successfully, but these errors were encountered: