Browse Source

Remove legacy HTML/JS, deterministic server

master
Pete Shadbolt 8 years ago
parent
commit
b2917465fe
5 changed files with 4 additions and 55 deletions
  1. +3
    -23
      abp/build_tables.py
  2. +0
    -1
      abp/static/index.html
  3. +0
    -8
      abp/static/scripts/tables.js
  4. +0
    -23
      abp/static/test.html
  5. +1
    -0
      bin/abpserver

+ 3
- 23
abp/build_tables.py View File

@@ -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)

+ 0
- 1
abp/static/index.html View File

@@ -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>


+ 0
- 8
abp/static/scripts/tables.js
File diff suppressed because it is too large
View File


+ 0
- 23
abp/static/test.html View File

@@ -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>

+ 1
- 0
bin/abpserver View File

@@ -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()




Loading…
Cancel
Save