Add Graph States to QuComputState



Graph state is a kind of notation of graphs in a quantum state version. It is widely used in surface coding, one-way quantum computing (also known as measurement-based computing), and probably some other amazing places. I add this type in order to implement the simulation about one-way quantum computing in QuCmp.jl.

New Dependencies

LightGraphs.jl An optimized graphs package for Julia


Type structure

The graph state’s data is stored in a LightGraphs.jl Graph type.

type GraphState



Graph state can be converted to a normal state vector. Suppose \(S_1,S_2,S_m\) are the stabilizers of graph state \(|G\rangle\). Define Hamiltonian \(H\)

\[ H = \sum_i S_i \]

The state vector of \(|G\rangle\) can be proved to be the ground state of \(H\). Therefore, the convert function is defined to use Julia’s function eigs to calculate the eigen vector of sparse matrix H, and is normalized by normalize


Stabilizer group is calculated in this method : stabilizers, with a return collection of all stabilizers defined by a certain graph structure

LC equivalence

LC equivalence is evaluated by isLCeq

\[ \mathbf{flag} = (\mathbf{1}|\mathbf{\Gamma}\^{A}) \mathbf{P} (\mathbf{1}|\mathbf{\Gamma}\^{B})^T \]

where \(\mathbf{\Gamma}\) is the adjacency matrix of graph A, while \(\mathbf{\Gamma'}\) is the adjacency matrix of graph B, and \(\mathbf{P}\) is defined below

\[ \begin{pmatrix} \mathbf{0} & \mathbf{1} \\\\ \mathbf{1} & \mathbf{0} \end{pmatrix} \]

A is LC-equivalent to B, only when \(\mathbf{flag}\) is a zero matrix.

To-Do and To be decided

I’m note sure whether it is better to include GraphState in AbstractQuState or a subtype of AbstractQuVector in QuBase or just let it be a single type. The problem is I can not convert a given state vector to a GraphState or stlzState due to their space are not actually equal.