浏览代码

Remove legacy HTML/JS, deterministic server

master
Pete Shadbolt 8 年前
父节点
当前提交
b2917465fe
共有 5 个文件被更改,包括 4 次插入55 次删除
  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 查看文件

@@ -17,17 +17,6 @@ DECOMPOSITIONS = (
"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 = """\
import numpy as np

@@ -222,17 +211,8 @@ def write_python(data):
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__':
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 查看文件

@@ -8,7 +8,6 @@
<link rel="stylesheet" href="main.css">
<script src="scripts/three.js"></script>
<script src="scripts/orbitcontrols.js"></script>
<script src="scripts/tables.js"></script>
<script src="scripts/anders_briegel.js"></script>
<script src="scripts/mouse.js"></script>
<script src="scripts/materials.js"></script>


+ 0
- 8
abp/static/scripts/tables.js
文件差异内容过多而无法显示
查看文件


+ 0
- 23
abp/static/test.html 查看文件

@@ -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 查看文件

@@ -17,6 +17,7 @@ from pkg_resources import resource_filename
from pprint import pprint
import time

abp.DETERMINISTIC = True
clients = []
local_state = abp.GraphState()



正在加载...
取消
保存