Anders and Briegel in Python
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

test_nxgraphstate.py 337B

1234567891011121314
  1. from abp.graphstate import GraphState
  2. from abp.util import xyz
  3. import networkx as nx
  4. def simple_test():
  5. g = GraphState()
  6. g.add_node(0, position = xyz(10, 0, 0))
  7. g.add_node(1, position = xyz(1, 0, 0))
  8. g.act_hadamard(0)
  9. g.act_hadamard(1)
  10. g.act_cz(0, 1)
  11. print g.node[0]["position"]
  12. print nx.to_edgelist(g)