diff --git a/abp/clifford.py b/abp/clifford.py index c22437e..dc444ab 100644 --- a/abp/clifford.py +++ b/abp/clifford.py @@ -13,9 +13,9 @@ The complete set of aliases for single-qubit Cliffords is as follows: Index Aliases ======= ========================= 0 ``IA, identity, identity_h`` - 1 ``px, XA, px_h`` - 2 ``py, YA, py_h`` - 3 ``pz, ZA, pz_h`` + 1 ``XA, px, px_h`` + 2 ``YA, py, py_h`` + 3 ``ZA, pz, pz_h`` 4 ``IB`` 5 ``XB, sqz, msqz_h, phase_h`` 6 ``YB, msqz, sqz_h, phase`` @@ -61,7 +61,7 @@ def human_name(i): return choices[-1] def is_diagonal(v): - """ TODO: remove this. Checks if a VOP is diagonal or not """ + """ Checks if a VOP is diagonal or not """ return v in {0, 3, 5, 6} diff --git a/bin/abpserver b/bin/abpserver index 902cc20..2f0321d 100755 --- a/bin/abpserver +++ b/bin/abpserver @@ -1,4 +1,9 @@ #!/usr/bin/python +""" +This is a simple websocket relay server that facilitates realtime visualization of GraphStates. +It doesn't do much except echo websocket messages to all connected clients, and serve some static content over HTTP. +""" + from websocket_server import WebsocketServer from SimpleHTTPServer import SimpleHTTPRequestHandler from BaseHTTPServer import HTTPServer @@ -11,7 +16,6 @@ from pkg_resources import resource_filename clients = [] - def new_message(client, server, message): print "Received update from client {}.".format(client["id"]) server.send_message_to_all(message) @@ -29,7 +33,7 @@ class ThreadedHTTPServer(ThreadingMixIn, HTTPServer): if __name__ == '__main__': parser = argparse.ArgumentParser(description = "ABP websocket server") - parser.add_argument("-v", action="store_false", help="Launch browser") + parser.add_argument("-v", action="store_true", help="Launch browser") args = parser.parse_args() # Change to the right working dir diff --git a/doc/index.rst b/doc/index.rst index be876a4..7eaba33 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -130,8 +130,9 @@ Now, in another terminal, use ``abp.fancy.GraphState`` to run a Clifford circuit >>> g = GraphState(range(10)) >>> g.act_circuit([(i, "hadamard") for i in range(10)]) >>> g.act_circuit([((i, i+1), "cz") for i in range(9)]) + >>> g.update() -And you should see a 3D visualization of the state. +And you should see a 3D visualization of the state. You can call ``update()`` in a loop to see an animation. .. image:: ../examples/viz.png