Closed sammorley-short closed 8 years ago
I disagree with some of this.
add_edge
should not be identical to act_cz
-- it should be possible to add an edge where a CZ would not create an edge due to VOPs.
add_node
probably should initialize in |+〉 because, as you say, "node" is the language of graph states, which are naturally initialized in |+〉.
This will break some tests, I will find some time to deal with it,
My problem with add_edge not being the same as act_cz (and perhaps I'm wrong on this) is that doesn't this then cause a problem between what you are seeing in the visualiser, and what the state actually is? Or does abp deal with all that? It seems to me you might end up screwing with the states your describing if removing an edge from a highly entangled graph doesn't perform some sort of disentanglement on the state.
Any graph with any set of VOPs is a valid quantum state. What do you mean by "screwing with the states"?
The image in abpserver
should be a dumb 1-to-1 representation of the current state -- if there's a discrepancy between abp
's representation and the figure, that's a bug.
Ah ok. So in that case I just didn't see in what situation it would be used, but that's no reason to remove it I guess. It just feels like a really strange operation as it doesn't represent a single quantum operation on the state, but some weird, state-specific combination of CZ's and VOP's
Agreed. It is also used internally a lot. We could make it a private method and remove it from the docs. Same with add_node(s)
. I think that's a really good compromise actually.
s/add_node/_add_node
Yeah, that's the best solution, keeps it simple. Perhaps then it would make sense to have some from_graph(nx_graph)
method so you can quickly initialise from a graph structure, but then are forced to edit it as a GraphState()
object going forwards (i.e. using add_qubit()
and act_hadamard()
)?
NB: _add_edge
is already private and undocumented to dissuade n00b usage.
In graph state language a node and edge refer to a plus state and cz respectively, however, adding a node initialises a computational basis '0' state and adding an edge does not act a cz.
Suggested edits:
GraphState.add_node(node)
,GraphState.add_nodes(nodes)
should initialise qubits into plus state, andadd_edge
should perform the same asact_cz
.add_qubit(qubit)
,add_qubits(qubits)
to initialise "0" state qubits.