Skip to content

Commit

Permalink
Merge pull request ScQ-Cloud#150 from lss0208/master
Browse files Browse the repository at this point in the history
fix:openqasm bug
  • Loading branch information
ScQ-Cloud authored Mar 28, 2024
2 parents 2c114ba + 6d7bfdf commit 6af2082
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion quafu/circuits/quantum_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,10 @@ def to_openqasm(self, with_para=False) -> str:
Returns:
openqasm text.
"""
valid_gates = QuantumGate.gate_classes # TODO:include instruction futher

valid_gates = list(QuantumGate.gate_classes.keys()) #TODO:include instruction futher
valid_gates.extend(["barrier", "delay", "reset"])

qasm = 'OPENQASM 2.0;\ninclude "qelib1.inc";\n'
qasm += "qreg q[%d];\n" % self.num
qasm += "creg meas[%d];\n" % self.cbits_num
Expand Down

0 comments on commit 6af2082

Please sign in to comment.