The following circuit generates the eight GHZ maximally entangled states. A similar NMR circuit can be found on page 287 of The Quest for the Quantum Computer by Julian Brown. \[ \begin{matrix} \text{Index} \\ | a \rangle & \triangleright & \cdots & \oplus & \cdots & \triangleright & \text{G} \\ ~ & ~ & ~ & | \\ | b \rangle & \triangleright & \text{H} & \cdot & \cdot & \triangleright & \text{H} \\ ~ & ~ & ~ & ~ & | \\ | c \rangle & \triangleright & \cdots & \cdots & \oplus & \triangleright & \text{Z} \end{matrix} \nonumber \] Given the quantum gates in matrix form the quantum circuit is formed using Kronecker multiplication. \[ \begin{matrix} \text{I} = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} & \text{H} = \frac{1}{ \sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} & \text{CNOT} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{pmatrix} & \text{ICNOT} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \end{pmatrix} \end{matrix} \nonumber \] \[ \text{GHZ} = \text{kronecker(I, CNOT) kronecker(ICNOT, I) kronecker(I, kronecker(H, I))} \nonumber \] Using the index as input the quantum circuit generates the corresponding GHZ state. \[ \begin{matrix} G_0 = \text{GHZ} \begin{pmatrix} 1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{pmatrix} = \begin{pmatrix} 0.707 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0.707 \end{pmatrix} & \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \frac{1}{ \sqrt{2}} \left[ \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} + \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \right] \\ G_1 = \text{GHZ} \begin{pmatrix} 0 \\ 1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 0.707 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0.707 \\ 0 \end{pmatrix} & \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} = \frac{1}{ \sqrt{2}} \left[ \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} + \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \right] \\ G_2 = \text{GHZ} \begin{pmatrix} 0 \\ 0 \\ 1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{pmatrix} = \begin{pmatrix} 0.707 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ \\ 0 \\ -0.707 \end{pmatrix} & \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \frac{1}{ \sqrt{2}} \left[ \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} - \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \right] \\ G_3 = \text{GHZ} \begin{pmatrix} 0 \\ 0 \\ 0 \\ 1 \\ 0 \\ 0 \\ 0 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 0.707 \\ 0 \\ 0 \\ 0 \\ 0 \\ \\ -0.707 \\ 0 \end{pmatrix} & \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} = \frac{1}{ \sqrt{2}} \left[ \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} - \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \right] \\ G_4 = \text{GHZ} \begin{pmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 1 \\ 0 \\ 0 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 0 \\ 0.707 \\ 0.707 \\ 0 \\ \\ 0 \\ 0 \end{pmatrix} & \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \frac{1}{ \sqrt{2}} \left[ \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} + \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \right] \\ G_5 = \text{GHZ} \begin{pmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 1 \\ 0 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 0.707 \\ 0 \\ 0 \\ 0.707 \\ 0 \\ 0 \end{pmatrix} & \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} = \frac{1}{ \sqrt{2}} \left[ \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} + \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \right] \\ G_6 = \text{GHZ} \begin{pmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 0 \\ -0.707 \\ 0.707 \\ 0 \\ 0 \\ 0 \end{pmatrix} & \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \frac{1}{ \sqrt{2}} \left[ \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} - \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \right] \\ G_7 = \text{GHZ} \begin{pmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 1 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ -0.707 \\ 0 \\ 0 \\ 0.707 \\ 0 \\ 0 \end{pmatrix} & \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} = \frac{1}{ \sqrt{2}} \left[ \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} - \begin{pmatrix} 1 \\ 0 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} \right] \end{matrix} \nonumber \] Given the following truth tables the operation of the circuit is followed algebraically for G 2 and G 4 . \[ \begin{matrix} \text{Identity} & \begin{pmatrix} \text{0 to 0} \\ \text{1 to 1} \end{pmatrix} & \text{Hadamard} & \text{H} = \begin{bmatrix} \text{0 to}~ \frac{(0 + 1)}{ \sqrt{2}} \text{ to 0} \\ \text{1 to}~ \frac{(0 - 1)}{ \sqrt{2}} \text{ to 1} \end{bmatrix} \\ \text{ICNOT} & \begin{pmatrix} \text{Decimal} & \text{Binary} & \text{to} & \text{Binary} & \text{Decimal} \\ 0 & 00 & \text{to} & 00 & 0 \\ 1 & 01 & \text{to} & 11 & 3 \\ 2 & 10 & \text{to} & 10 & 2 \\ 3 & 11 & \text{to} & 01 & 1 \end{pmatrix} & \text{CNOT} & \begin{pmatrix} \text{Decimal} & \text{Binary} & \text{to} & \text{Binary} & \text{Decimal} \\ 0 & 00 & \text{to} & 00 & 0 \\ 1 & 01 & \text{to} & 01 & 1 \\ 2 & 10 & \text{to} & 11 & 3 \\ 3 & 11 & \text{to} & 10 & 2 \end{pmatrix} \end{matrix} \nonumber \] \[ \begin{matrix} |010 \rangle & |100 \rangle \\ \text{I} \otimes \text{H} \otimes \text{I} & \text{I} \otimes \text{H} \otimes \text{I} \\ |0 \rangle \left( \frac{|0 \rangle - | 1 \rangle}{ \sqrt{2}} \right) |0 \rangle = \frac{1}{ \sqrt{2}} \left[ |000 \rangle - |010 \rangle \right] & |1 \rangle \left( \frac{|0 \rangle + | 1 \rangle}{ \sqrt{2}} \right) |0 \rangle = \frac{1}{ \sqrt{2}} \left[ |100 \rangle + |110 \rangle \right] \\ \text{ICNOT} \otimes \text{I} & \text{ICNOT} \otimes \text{I} \\ \frac{1}{ \sqrt{2}} \left[ |000 \rangle - |110 \rangle \right] & \frac{1}{ \sqrt{2}} \left[ |100 \rangle + |010 \rangle \right] \\ \text{I} \otimes \text{CNOT} & \text{I} \otimes \text{CNOT} \\ \frac{1}{ \sqrt{2}} \left[ |000 \rangle - |111 \rangle \right] & \frac{1}{ \sqrt{2}} \left[ |100 \rangle + |011 \rangle \right] \end{matrix} \nonumber \] Next the GHZ density matrices are presented graphically. Using the GHZ states as input and running the circuit in reverse yields the indices. \[ \text{IGHZ} = \text{GHZ}^-1 \nonumber \] \[ \begin{matrix} \text{IGHZ G}_0 = \begin{pmatrix} 1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{pmatrix} & \text{IGHZ G}_1 = \begin{pmatrix} 0 \\ 1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{pmatrix} & \text{IGHZ G}_2 = \begin{pmatrix} 0 \\ 0 \\ 1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{pmatrix} & \text{IGHZ G}_3 = \begin{pmatrix} 0 \\ 0 \\ 0 \\ 1 \\ 0 \\ 0 \\ 0 \\ 0 \end{pmatrix} \\ \text{IGHZ G}_4 = \begin{pmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 1 \\ 0 \\ 0 \\ 0 \end{pmatrix} & \text{IGHZ G}_5 = \begin{pmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 1 \\ 0 \\ 0 \end{pmatrix} & \text{IGHZ G}_6 = \begin{pmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 1 \\ 0 \end{pmatrix} & \text{IGHZ G}_7 = \begin{pmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 1 \end{pmatrix} \end{matrix} \nonumber \]