瀏覽代碼

Multiple clients viewing / editing same state.

master
Pete Shadbolt 8 年之前
父節點
當前提交
f94d3eabd3
共有 2 個檔案被更改,包括 3 行新增2 行删除
  1. +2
    -1
      bin/abpserver
  2. +1
    -1
      examples/visualization/lattice_2d.py

+ 2
- 1
bin/abpserver 查看文件

@@ -42,7 +42,8 @@ def process_edit(edit, client, server):
else:
pass

server.send_message(client, json.dumps(local_state.to_json()))
#server.send_message(client, json.dumps(local_state.to_json()))
server.send_message_to_all(json.dumps(local_state.to_json()))

def new_message(client, server, message):
if message.startswith("edit:"):


+ 1
- 1
examples/visualization/lattice_2d.py 查看文件

@@ -34,7 +34,7 @@ nodes, edges = lattice(square_unit_cell, (10, 10))

psi = GraphState()
for node in nodes:
psi.add_node(str(node), position=xyz(node[0], node[1]))
psi.add_qubit(str(node), position=xyz(node[0], node[1]))
psi.act_hadamard(str(node))
psi.update(0.1)



Loading…
取消
儲存