State Generator
- class perceval.utils.stategenerator.StateGenerator(encoding, polarization_base=(|{P:H}>, |{P:V}>))
StateGenerator class for conveniently generating common complex StateVectors
- Parameters:
- bell_state(state)
Generate a StateVector representing a Bell state
- ghz_state(n)
Generate a StateVector representing a (generalized) Greenberger–Horne–Zeilinger state
- Parameters:
n (
int
) – order of the GHZ state- Returns:
StateVector representing the GHZ state
- graph_state(graph)
Generate a StateVector representing a graph state.
- Parameters:
graph (
Graph
) – networkx.Graph object. Edge weights are ignored.- Returns:
StateVector representing the graph state
- logical_state(state)
Generate a StateVector from a list of logical state
- Parameters:
state (
List
[int
]) – list of bits- Returns:
StateVector representing the logical state