-
Notifications
You must be signed in to change notification settings - Fork 1
/
toolparameters.js
84 lines (70 loc) · 3.73 KB
/
toolparameters.js
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
var toolParameters = [];
function resetToolParameters()
{
toolParameters.decomposeCliffordT = false;
toolParameters.distillAndConsumeTStates = false;
toolParameters.oneTGatePerTimestep = false;
toolParameters.distillationLength = 3;
// toolParameters.reorderWires = false;
// toolParameters.resetWires = false;
toolParameters.nrLogQubits = 0;//number of log qubits used for controlling the logical qubits
toolParameters.nrQubits = 0;// number of logical qubits in the circuit
toolParameters.nrVars = 0;// total number of wires in circuit
toolParameters.lookAhead = 0;//look ahead for the analysis of T gates
toolParameters.circuitGenerator = "";
toolParameters.textAreas = {};
}
function readToolParameters()
{
//reinit references cache?
toolParameters.textAreas["circuit"] = document.getElementById("circuit");
toolParameters.textAreas["circuitnew"] = document.getElementById("circuitnew");
toolParameters.textAreas["quirkLink"] = document.getElementById("quirkLink");
toolParameters.textAreas["stats"] = document.getElementById("stats");
toolParameters.circuitGenerator = document.getElementById("circuitgenerator").value;
toolParameters.decomposeCliffordT = document.getElementById("decomposeCheckBox").checked;
// toolParameters.reorderWires = document.getElementById("reorderwires").checked;
toolParameters.distillAndConsumeTStates = document.getElementById("distillandconsume").checked;
toolParameters.oneTGatePerTimestep = document.getElementById("onetpertime").checked;
toolParameters.noVisualisation = document.getElementById("novisual").checked;
// toolParameters.nrLogQubits = Number(document.getElementById("nrq").value);
toolParameters.lookAhead = Number(document.getElementById("lookahead").value);
toolParameters.maximumAAvailable = Number(document.getElementById("nrMaxAvailable").value);
if(toolParameters.maximumAAvailable == 0)
{
// disable the limitation
toolParameters.maximumAAvailable = -1;
}
if(toolParameters.circuitGenerator == "majorana")
{
// old version
// toolParameters.nrQubits = Math.pow(2, toolParameters.nrLogQubits);
// toolParameters.nrVars = toolParameters.nrQubits + 2 * toolParameters.nrLogQubits + 1 /*control*/;
toolParameters.nrQubits = Math.ceil(Math.log2(toolParameters.nrLogQubits));
//toolParameters.nrVars = 2*toolParameters.nrQubits + toolParameters.nrLogQubits + 1 /*control*/;
toolParameters.nrControls = 2*toolParameters.nrQubits + 1;
toolParameters.nrDataQubits = toolParameters.nrLogQubits;
toolParameters.nrVars = Number(document.getElementById("totalqubitsnight").value);
}
// else if(toolParameters.circuitGenerator == "qrom")
// {
// toolParameters.nrLogQubits *= 1.5;
//
// toolParameters.nrQubits = Math.ceil(Math.log2(toolParameters.nrLogQubits));
// //toolParameters.nrVars = 2*toolParameters.nrQubits + toolParameters.nrQubits + 1 /*control*/;
//
// toolParameters.nrControls = 2*toolParameters.nrQubits + 1;
// toolParameters.nrDataQubits = toolParameters.nrQubits + Number(document.getElementById("munight").value);
//
// toolParameters.nrVars = Number(document.getElementById("totalqubitsnight").value);
//
// // //old version of qrom
// // toolParameters.nrQubits = Math.pow(2, toolParameters.nrLogQubits);
// // toolParameters.nrVars = toolParameters.nrQubits + 2 * toolParameters.nrLogQubits + 1 /*control*/;
// }
// else if(toolParameters.circuitGenerator == "adder")
// {
// toolParameters.nrQubits = 3 * (toolParameters.nrLogQubits - 1 ) + 2;
// toolParameters.nrVars = toolParameters.nrQubits;
// }
}