Skip to content

Commit 1ba672e

Browse files
committed
Fixed antlr4 to earlier version
1 parent 1c519d2 commit 1ba672e

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

lib/quantum-circuit.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2647,7 +2647,9 @@ QuantumCircuit.prototype.defaultHybridOptions = function() {
26472647
};
26482648
};
26492649

2650-
QuantumCircuit.prototype.init = function(numQubits) {
2650+
QuantumCircuit.prototype.init = function(numQubits, options) {
2651+
options = options || {};
2652+
26512653
this.numQubits = numQubits || 1;
26522654
this.gates = [];
26532655
this.partitionMap = [];
@@ -2662,7 +2664,10 @@ QuantumCircuit.prototype.init = function(numQubits) {
26622664
hybridOptions: this.defaultHybridOptions()
26632665
};
26642666

2665-
this.customGates = {};
2667+
if(!options.keepCustomGates) {
2668+
this.customGates = {};
2669+
}
2670+
26662671
this.cregs = {};
26672672
this.collapsed = [];
26682673
this.prob = [];
@@ -2684,6 +2689,7 @@ QuantumCircuit.prototype.clear = function() {
26842689
this.initState();
26852690
};
26862691

2692+
26872693
QuantumCircuit.prototype.resetState = function() {
26882694
// reset state
26892695
this.state = {};
@@ -9436,7 +9442,7 @@ QuantumCircuit.prototype.exportToAQASM = function(options, isExportPyAQASM, expo
94369442
}
94379443
name += "]";
94389444
if (k < aqasmInfo.matrix.length - 1){
9439-
name += " ";``
9445+
name += " ";
94409446
}
94419447
}
94429448
name += "]";

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "quantum-circuit",
3-
"version": "0.9.171",
3+
"version": "0.9.174",
44
"description": "Quantum Circuit Simulator",
55
"main": "lib/quantum-circuit.js",
66
"unpkg": "dist/quantum-circuit.min.js",
@@ -37,8 +37,8 @@
3737
},
3838
"homepage": "https://quantum-circuit.com",
3939
"dependencies": {
40-
"antlr4": "^4.8.0",
41-
"mathjs": "^6.6.5"
40+
"antlr4": "4.7.2",
41+
"mathjs": "^6.0.3"
4242
},
4343
"devDependencies": {
4444
"browserify": "^16.5.1",

0 commit comments

Comments
 (0)