-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathbell.js
More file actions
38 lines (26 loc) · 764 Bytes
/
bell.js
File metadata and controls
38 lines (26 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
var QuantumCircuit = require("../../lib/quantum-circuit.js");
var circ = new QuantumCircuit();
circ.addGate("h", -1, 0);
circ.addGate("cx", -1, [0, 1]);
circ.run();
console.log("");
console.log(circ.exportQASM());
console.log("");
console.log(circ.exportPyquil());
//console.log("");
//console.log(JSON.stringify(circ.exportRaw(), null, '\t'));
console.log("");
console.log("Final amplitudes:");
circ.print(true);
console.log("");
console.log("Angles:");
console.log(circ.angles());
console.log("");
console.log("Probabilities:");
console.log(circ.probabilities());
console.log("");
console.log("Measured (single-shot)");
console.log(circ.measureAll());
console.log("");
console.log("Counts (1000 shots)");
console.log(circ.measureAllMultishot(1000));