@@ -17,17 +17,6 @@ DECOMPOSITIONS = ( | |||||
"xxxzx", "xzz", "zzx", "xxx", "x", "zzzx", "xxzx", "zx", "zxxx", "xxxz", "xzzz", "xz", "xzxx") | "xxxzx", "xzz", "zzx", "xxx", "x", "zzzx", "xxzx", "zx", "zxxx", "xxxz", "xzzz", "xz", "xzxx") | ||||
JS_TEMPLATE = """\ | |||||
var tables = {{ | |||||
decompositions : {decompositions}, | |||||
conjugation_table : {conjugation_table}, | |||||
times_table : {times_table}, | |||||
cz_table : {cz_table}, | |||||
clifford : {by_name}, | |||||
measurement_table: {measurement_table} | |||||
}}; | |||||
""" | |||||
PY_TEMPLATE = """\ | PY_TEMPLATE = """\ | ||||
import numpy as np | import numpy as np | ||||
@@ -222,17 +211,8 @@ def write_python(data): | |||||
f.write(content) | f.write(content) | ||||
def write_javascript(data): | |||||
""" Write the tables to javascript files for consumption in the browser """ | |||||
path = join(split(dirname(__file__))[0], "static/scripts/tables.js") | |||||
content = JS_TEMPLATE.format(**data) | |||||
with open(path, "w") as f: | |||||
f.write(content) | |||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
get_display_table(get_unitaries()) | get_display_table(get_unitaries()) | ||||
#data = compute_everything() | |||||
#data = human_readable(data) | |||||
# write_python(data) | |||||
# write_javascript(data) | |||||
data = compute_everything() | |||||
data = human_readable(data) | |||||
write_python(data) |
@@ -8,7 +8,6 @@ | |||||
<link rel="stylesheet" href="main.css"> | <link rel="stylesheet" href="main.css"> | ||||
<script src="scripts/three.js"></script> | <script src="scripts/three.js"></script> | ||||
<script src="scripts/orbitcontrols.js"></script> | <script src="scripts/orbitcontrols.js"></script> | ||||
<script src="scripts/tables.js"></script> | |||||
<script src="scripts/anders_briegel.js"></script> | <script src="scripts/anders_briegel.js"></script> | ||||
<script src="scripts/mouse.js"></script> | <script src="scripts/mouse.js"></script> | ||||
<script src="scripts/materials.js"></script> | <script src="scripts/materials.js"></script> | ||||
@@ -1,23 +0,0 @@ | |||||
<!DOCTYPE html> | |||||
<html> | |||||
<head> | |||||
<meta charset="utf-8"> | |||||
<meta name="viewport" content="width=device-width"> | |||||
<title>Testing A&B</title> | |||||
<link rel="stylesheet" href="test.css"> | |||||
</head> | |||||
<body> | |||||
<script src="scripts/qcengine/qcengine_bitfield.js"></script> | |||||
<script src="scripts/qcengine/qcengine_reg.js"></script> | |||||
<script src="scripts/qcengine/qcengine_int.js"></script> | |||||
<script src="scripts/qcengine/qcengine_basicops.js"></script> | |||||
<script src="scripts/qcengine/qcengine_setup.js"></script> | |||||
<script src="scripts/tables.js"></script> | |||||
<script src="scripts/anders_briegel.js"></script> | |||||
<div id="qunit"></div> | |||||
<div id="qunit-fixture"></div> | |||||
<script src="https://code.jquery.com/qunit/qunit-1.23.1.js"></script> | |||||
<script src="scripts/tests.js"></script> | |||||
</body> | |||||
</html> |
@@ -17,6 +17,7 @@ from pkg_resources import resource_filename | |||||
from pprint import pprint | from pprint import pprint | ||||
import time | import time | ||||
abp.DETERMINISTIC = True | |||||
clients = [] | clients = [] | ||||
local_state = abp.GraphState() | local_state = abp.GraphState() | ||||