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
Expected behavior
When creating a simple empty circuit with a single final measurement, the exported QASM file should have only one definition for the classical register.
Actual behavior
The exported QASM file has two definitions for the classical register, which leads to an invalid QASM file that cannot be imported by either BQSKit or Qiskit.
Additional information
The reproducibility of this issue is full (100%). The error is raised every time the circuit is exported and imported.
Source code
Here is the minimal example to generate the buggy QASM file:
The issue may be due to the exporter generating duplicate instructions for classical registers. This could be caused by a bug in the QASM generation or instruction creation process. Investigating the generation of QASM for classical registers may help identify the root cause of the issue, which may be related to the number of times the register is exported.
Note that when the size of the register is n the number of times the register is exported is n (tested with size up to n=32).
This seems to happen because of the presence of the qc.measure(qr, cr) instruction, so the issue may be related to the handling of this instruction in the QASM generation process.
The text was updated successfully, but these errors were encountered:
Environment
Expected behavior
When creating a simple empty circuit with a single final measurement, the exported QASM file should have only one definition for the classical register.
Actual behavior
The exported QASM file has two definitions for the classical register, which leads to an invalid QASM file that cannot be imported by either BQSKit or Qiskit.
Additional information
The reproducibility of this issue is full (100%). The error is raised every time the circuit is exported and imported.
Source code
Here is the minimal example to generate the buggy QASM file:
Tracebacks
When trying to import the QASM file with Qiskit:
When trying to import the QASM file with BQSKit:
Potential Solution/Insight:
The issue may be due to the exporter generating duplicate instructions for classical registers. This could be caused by a bug in the QASM generation or instruction creation process. Investigating the generation of QASM for classical registers may help identify the root cause of the issue, which may be related to the number of times the register is exported.
Note that when the size of the register is n the number of times the register is exported is n (tested with size up to n=32).
This seems to happen because of the presence of the
qc.measure(qr, cr)
instruction, so the issue may be related to the handling of this instruction in the QASM generation process.The text was updated successfully, but these errors were encountered: