Anders and Briegel in Python
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

make_js_stuff.py 615B

12345678910111213141516171819202122232425
  1. from abp import clifford
  2. import json
  3. with open("../server/tables.js", "w") as f:
  4. f.write("var decompositions = ")
  5. f.write(json.dumps(clifford.decompositions))
  6. f.write(";\n")
  7. f.write("var conjugation_table = ")
  8. f.write(json.dumps(clifford.conjugation_table.tolist()))
  9. f.write(";\n")
  10. f.write("var times_table = ")
  11. f.write(json.dumps(clifford.times_table.tolist()))
  12. f.write(";\n")
  13. f.write("var cz_table = ")
  14. f.write(json.dumps(clifford.cz_table.tolist()))
  15. f.write(";\n")
  16. f.write("var clifford = ")
  17. f.write(json.dumps(clifford.by_name))
  18. f.write(";\n")