Skip to content

Commit 8d24c44

Browse files
committed
fixed creg length
1 parent 86e8033 commit 8d24c44

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/quantum-circuit.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9053,7 +9053,11 @@ QuantumCircuit.prototype.exportToAQASM = function(options, isExportPyAQASM, expo
90539053
aqasm += indent + "qubits " + numQubits + "\n";
90549054

90559055
if (circuit.cregs){
9056-
aqasm += indent + "cbits " + circuit.cregs.length + "\n";
9056+
var cregLength = 0;
9057+
for(var creg in circuit.cregs){
9058+
cregLength += circuit.cregs[creg].length;
9059+
}
9060+
aqasm += indent + "cbits " + cregLength + "\n";
90579061
}
90589062
}else {
90599063
if(exportAsGateName){

0 commit comments

Comments
 (0)