public class GraphRegister extends Object
For a detailed description of the graphic state formalism and its algorithms see the article
S. Anders, H. J. Briegel: 'Fast simulation of Stabilizer Circuits using a Graph States Formalism', Phys. Rev. A 73, 022334 (2006) DOI: 10.1103/PhysRevA.73.022334 (Preprint: quant-ph/0504117)
This class is based essentially on the C++ program graphsim.cpp, version 0.10 from 2005/01/27 written by Simon Anders, downloadable under http://homepage.uibk.ac.at/~c705213/work/graphsim.html| Constructor and Description | 
|---|
GraphRegister(int size)
Creates a register of n qubits, initialized to the state |0>. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
bitFlip(int v)
Applies a bitflip gate, i.e., a Pauli X, on vertex v. 
 | 
void | 
cNOT(int vc,
    int vt)
Performs a controlled NOT gate between the vertices vc (control) and vt (target). 
 | 
void | 
cPhase(int v1,
      int v2)
Does a conditional phase gate c-S between the two qubits. 
 | 
boolean | 
equals(Object o)
Compares the specified object with this local Clifford operator. 
 | 
Register | 
getRegister()
Returns the quantum register (in state vecor representation) 
 represented by this graph register. 
 | 
void | 
hadamard(int v)
Apply a Hadamard gate on vertex v. 
 | 
int | 
hashCode()
Returns the hash code for this graph register state. 
 | 
void | 
inverseSGate(int v)
Applies an inverse S gate on vertex v. 
 | 
int | 
measure(int v)
Measures qubit v with the Pauli Z gate as basis operator and returns the measured
 value. 
 | 
int | 
measure(int v,
       LocalCliffordOperator basis)
Measures qubit v in the specified basis operator and returns the measured
 value. 
 | 
void | 
phaseFlip(int v)
Apply a phase flip gate (i.e. a Pauli-Z) on vertex v. 
 | 
void | 
phaseRot(int v)
Apply a phase gate S on qubit v. 
 | 
void | 
sGate(int v)
Applies an  S gate, or "phase gate", on vertex v. 
 | 
String | 
toString()
Returns a string representation of this register. 
 | 
void | 
xPauli(int v)
Applies a Pauli-X, or "bit flip", on vertex v. 
 | 
void | 
yPauli(int v)
Applies a Pauli-Y on vertex v. 
 | 
void | 
zPauli(int v)
Applies a Pauli-Z, or "phase flip", on vertex v. 
 | 
public GraphRegister(int size)
size - the number of qubits this register consists ofpublic Register getRegister()
public void hadamard(int v)
v - the qubit on which the gate is to be applied
  (in an n qubit register, v = 0, 1, ..., n - 1)public void xPauli(int v)
v - the qubit on which the gate is to be applied
  (in an n qubit register, v = 0, 1, ..., n - 1)bitFlip(int)public void yPauli(int v)
v - the qubit on which the gate is to be applied
  (in an n qubit register, v = 0, 1, ..., n - 1)public void zPauli(int v)
v - the qubit on which the gate is to be applied
  (in an n qubit register, v = 0, 1, ..., n - 1)phaseFlip(int)public void sGate(int v)
v - the qubit on which the gate is to be applied
  (in an n qubit register, v = 0, 1, ..., n - 1)public void inverseSGate(int v)
v - the qubit on which the gate is to be applied
  (in an n qubit register, v = 0, 1, ..., n - 1)sGate(int)public void bitFlip(int v)
v - the qubit on which the gate is to be applied
  (in an n qubit register, v = 0, 1, ..., n - 1)xPauli(int)public void phaseFlip(int v)
v - the qubit on which the gate is to be applied
  (in an n qubit register, v = 0, 1, ..., n - 1)public void phaseRot(int v)
v - the qubit on which the gate is to be applied
  (in an n qubit register, v = 0, 1, ..., n - 1)public void cPhase(int v1,
                   int v2)
v1 - the control qubit 
 (in an n qubit register, v1 = 0, 1, ..., n - 1v2 - the target qubit
 (in an n qubit register, v2 = 0, 1, ..., n - 1public void cNOT(int vc,
                 int vt)
vc - the control qubit 
 (in an n qubit register, vc = 0, 1, ..., n - 1)vt - the target qubit 
 (in an n qubit register, vc = 0, 1, ..., n - 1)public int measure(int v)
v - the measured qubit 
 (in an n qubit register, v = 0, 1, ..., n - 1)public int measure(int v,
                   LocalCliffordOperator basis)
v - the measured qubit 
 (in an n qubit register, v = 0, 1, ..., n - 1)basis - the Pauli gate which serves as measurement basispublic boolean equals(Object o)
public int hashCode()
public String toString()