-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
137 lines (126 loc) · 5.29 KB
/
index.html
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv ="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bloch_Sphere</title>
<link rel="stylesheet" href="./style.css">
<script type = "module" src="./main.js"></script>
<style>
#myDIV {
width: 100%;
padding: 50px 0;
text-align: center;
background-color: #e5ecec ;
margin-top: 20px;
}
</style>
<!--
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/lib/p5.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/lib/addons/p5.sound.min.js"></script>
-->
<!-- <script type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"OrbitControls": "https://unpkg.com/[email protected]/examples/jsm/controls/OrbitControls.js"
}
}
</script> -->
</head>
<body>
<h1> The Bloch Sphere and Quantum Gates </h1>
<button onclick="myFunction()" style="display:block">Show/Hide text</button>
<div id="myDIV">
<p style="font-weight: bolder"> (INSERT TEXT THAT EXPLAINS SUBJECT OF VISUALISATION) </p>
</div>
<script>
function myFunction() {
var x = document.getElementById("myDIV");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
</script>
<br><br>
<br><br>
<div class="slidecontainer">
<hr>
<p style="color:#eee;
font-family: 'Montserrat', sans-serif; text-align:center; font-weight: bolder;">INITIAL STATE PARAMETERS:</p>
<hr>
<br><br>
<label style="color:#eee;
font-family: 'Montserrat', sans-serif;">Magnitude (r):</label><br>
<input type="range" min="0" max="1" value="0" step="0.01" class="slider" id="myRange_rad" onchange="rangevalue.value=value"/> <!--value is the default value-->
<br><br>
<br><br>
<label style="color:#eee;
font-family: 'Montserrat', sans-serif;">Polar angle (theta):</label><br>
<input type="range" min="0" max="3.14" value="0" step="0.01" class="slider" id="myRange_theta" onchange="rangevalue2.value=value"/>
<br><br>
<br><br>
<label style="color:#eee;
font-family: 'Montserrat', sans-serif;">Azimuthal angle (phi):</label><br>
<input type="range" min="0" max="6.28" value="0" step="0.01" class="slider" id="myRange_phi" onchange="rangevalue3.value=value"/>
<!---
<label>Rotation axis - x </label><br>
<input type="range" min="0" max="1" value="0" step="0.01" class="slider" id="xrotaxis" oninput="setAxis()"/>
<label>Rotation axis - y </label><br>
<input type="range" min="0" max="1" value="0" step="0.01" class="slider" id="yrotaxis" oninput="setAxis()"/>
<label>Rotation axis - z </label><br>
<input type="range" min="0" max="1" value="0" step="0.01" class="slider" id="zrotaxis" oninput="setAxis()"/>
-->
<span class="highlight"></span>
<p style="color:#eee;
font-family: 'Montserrat', sans-serif;"> Magnitude (r): <output id="rangevalue"></output> </p>
<span class="highlight2"></span>
<p style="color:#eee;
font-family: 'Montserrat', sans-serif;"> Polar angle (theta): <output id="rangevalue2"></output> </p>
<span class="highlight3"></span>
<p style="color:#eee;
font-family: 'Montserrat', sans-serif;"> Azimuthal angle (phi): <output id="rangevalue3"></output> </p>
</div>
<button id="btn_rad" type="submit" style="display:block">Go</button>
<br><br>
<hr>
<p style="color:#eee;
font-family: 'Montserrat', sans-serif; text-align:center; font-weight: bolder;">APPLY QUANTUM GATE:</p>
<hr>
<br><br>
<button id="paulixbutton" style="
margin-left: auto;
margin-right: auto"> Pauli-x gate </button>
<button id="pauliybutton" style="
margin-left: auto;
margin-right: auto"> Pauli-y gate </button>
<button id="paulizbutton" style="
margin-left: auto;
margin-right: auto"> Pauli-z gate </button>
<button id="hadamard" style="
margin-left: auto;
margin-right: auto"> Hadamard gate </button>
<button id="identity" style="
margin-left: auto;
margin-right: auto"> Identity gate </button>
<br><br>
<br><br>
<p style="color:#eee;
font-family: 'Montserrat', sans-serif; text-align:center;">(Zoom in below using your mousepad to start)</p>
<!--<p>Value: <span id="demo"></span></p>-->
</div>
<!--<script>
var slider = document.getElementById("myRange");
var output = document.getElementById("demo");
output.innerHTML = slider.value; // Display the default slider value
// Update the current slider value (each time you drag the slider handle)
slider.oninput = function() {
output.innerHTML = this.value;
}
</script>-->
<!--above line https://stackoverflow.com/questions/58211880/uncaught-syntaxerror-cannot-use-import-statement-outside-a-module-when-import-->
</body>
</html>