{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Cluster States\n",
"+ date: 2017-02-01"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In quantum information and quantum computing, a cluster state is a type of highly entangled state of multiple qubits. Cluster states are generated in lattices of qubits with Ising type interactions. A cluster C is a connected subset of a d-dimensional lattice, and a cluster state is a pure state of the qubits located on C. Another way of thinking of cluster states is as a particular instance of graph states, where the underlying graph is a connected subset of a d-dimensional lattice. Cluster states are especially useful in the context of the one-way quantum computer."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"$\\def\\bra#1{\\mathinner{\\langle{#1}|}}\n",
"\\def\\ket#1{\\mathinner{|{#1}\\rangle}}\n",
"\\def\\braket#1{\\mathinner{\\langle{#1}\\rangle}}\n",
"\\newcommand{\\ii}{\\mathrm{i}}\n",
"\\newcommand{\\tr}{\\mathrm{tr}}\n",
"\\newcommand{\\mdef}{\\overset{\\mathrm{def}}{=}}\n",
"$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Cluster State Hamiltion\n",
"\n",
"If no such a site $a$, we set $Z_a=1$.\n",
"\n",
"$$U=\\prod_a \\left[1-\\frac{(1+Z_{a})(1-Z_{a+1})}{2}\\right]=\\prod_a U_a,\\quad U=U^{-1}$$\n",
"$$\\begin{aligned}\n",
" V_a&\\mdef U_{a-1}U_a=\\frac{(1-Z_{a-1})+(1+Z_{a-1})Z_a}{2}\\cdot \\frac{(1+Z_{a+1})-(1-Z_{a+1})Z_a}{2}\\\\\n",
" &=Z_{a-}+Z_{a+}Z_a, \\qquad Z_{a\\pm}\\mdef\\frac{Z_{a+1}\\pm Z_{a-1}}{2}\\end{aligned}$$\n",
"\n",
"For high dimension, we should mark the $U$ by a $n$D coordinate as well\n",
"as an axis: $U_{a, b|c}$. For site $a, b$, the $V$ will be\n",
"$$V_{a,b}=U_{a,b|0}U_{a-1,b|0}U_{a,b|1}U_{a,b-1|1}=V_{a,b|0}V_{a,b|1},\\quad V_{a,b|i}=Z_{a,b|i-}+Z_{a,b|i+}Z_a$$\n",
"\n",
"$Z_{a\\pm}$ satisfy\n",
"$$Z_{a+}Z_{a-}=Z_{a-}Z_{a+}=0, \\quad Z_{a+}^2-Z_{a-}^2=Z_{a-1}Z_{a+1}, \\quad Z_{a+}^2+Z_{a-}^2=1,\\quad [Z_{a\\pm}, X_a^i]=0$$\n",
"\n",
"$$H_0=-\\sum_a X_a$$\n",
"\n",
"For the cluster state, its Hamiltonian is $$\\begin{aligned}\n",
" H&=UH_0U^{-1}=-\\sum_a UX_aU=-\\sum_a V_aX_aV_a\\\\\n",
" &=-\\sum_a (Z_{a-}+Z_aZ_{a-})X_a(Z_{a-}+Z_aZ_{a+})\\\\\n",
" &=-\\sum_a Z_{a-}^2X_a+Z_{a+}^2Z_aX_aZ_a\\\\\n",
" &=-\\sum_a (Z_{a-}^2-Z_{a+}^2)X_a\\\\\n",
" &=\\sum_a Z_{a-1}X_aZ_{a+1}\\end{aligned}$$\n",
"\n",
"As a generalization, we can get $$H=\\sum_{c} X_c\\prod_{d\\in n(c)} Z_d$$\n",
"\n",
"If we make a global $\\phi=\\pi/2$ rotation\n",
"$$\\Omega=\\prod_a\\exp\\left(-\\frac{\\ii \\phi Y_a}{2}\\right),\\quad z\\rightarrow x, x\\rightarrow -z$$\n",
"then $$H'=\\Omega H\\Omega^{-1}=-\\sum_a X_{a-1}Z_aX_{a+1}$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## The Property of Density Matrix\n",
"\n",
"Define\n",
"$$P_i{\\mdef}X_{i-1}Z_iX_{i+1},\\quad Q_i{\\mdef}X_{i-1}X_{i+1}$$\n",
"\n",
"Suppose $\\ket{\\phi_i}$ and $\\ket{\\psi_j}$ are eigenstates of odd $Z_k$\n",
"and even $Z_k$, respectively. For each state pair\n",
"$\\ket{\\phi_i}, \\ket{\\phi_j}$ with same eigenvalue of $\\prod_i Z_{2i+1}$,\n",
"there exist a transformation consists of $Q_i$ at even sites:\n",
"$$\\ket{\\phi_i}=\\prod_{a\\in S_{ij}} Q_a\\ket{\\phi_j}$$ Sites $S_{ij}$ is\n",
"determined by the two wave functions. The $\\mathrm{card}(S_{ij})$ is\n",
"nonzero as long as $\\ket{\\phi_i}\\neq\\ket{\\phi_j}$\n",
"\n",
"$$\\ket{\\Psi}=\\sum_{i,j}c_{ij} \\ket{\\phi_i}\\ket{\\psi_j}$$\n",
"\n",
"$$\\prod_{a\\in S_{ij}} P_a \\ket{\\phi_i}\\ket{\\psi_k}= \\prod_{a\\in S_{ij}} Q_aZ_a\\ket{\\phi_i}\\ket{\\psi_k}=\\ket{\\phi_j}\\prod_{a\\in S_{ij}} Z_a\\ket{\\psi_k}$$\n",
"$$\\rho_{\\phi}=\\tr_{\\psi}{\\ket{\\Psi}\\bra{\\Psi}}=\\sum_{i,j}\\ket{\\phi_i}\\bra{\\phi_j}\\sum_k c_{ik}c^*_{jk}\\braket{\\psi_k|\\psi_k}$$\n",
"$$\\begin{aligned}\n",
" \\braket{\\phi_j|\\rho_{\\phi}|\\phi_i}&=\\braket{\\phi_j|\\tr{\\left[\\prod_{a\\in S_{ij}} P_a\\ket{\\Psi}\\bra{\\Psi}\\right]}|\\phi_i}\\\\\n",
" &=\\sum_k |c_{jk}|^2\\braket{\\psi_k|\\prod_{a\\in S_{ij}} Z_a|\\psi_k}\\\\\n",
" &=C\\sum_k \\prod_{a\\in S_{ij}}z_a(\\psi_k)\\\\\n",
" &=\\delta_{ij}\\end{aligned}$$\n",
"\n",
"The last step holds as long as there exist a even site $a\\in S_{ij}$\n",
"which has a neighbor $b\\notin S_{ij}$. The condition is equivalent to\n",
"$\\phi_i\\neq\\phi_j$. In this case, there exist a conjugate state\n",
"$\\psi'_k$ which is flipped in the $a$th bit and cancels out the\n",
"contribution of $\\psi_k$.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Code for 1D Cluster state"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"tosign=lambda x:\"+\" if x>0 else \"-\"\n",
"class State:\n",
" '''Class to save a quantum state'''\n",
" sep_print=True\n",
" def __init__(self, ln=4, sign=1):\n",
" '''\n",
" ln list or the length of the all 1 list\n",
" sign sign\n",
" '''\n",
" self.sign=sign\n",
" if isinstance(ln, int):\n",
" self.n=ln\n",
" self.l=tuple(1 for i in range(ln))\n",
" else:\n",
" self.n=len(ln)\n",
" self.l=tuple(ln)\n",
" self.l2=self.l[0::2]+self.l[1::2]\n",
" def mutate(self, i):\n",
" '''Apply operator P_i to get a new state'''\n",
" l=list(self.l)\n",
" l[(i-1)%self.n]*=-1\n",
" l[(i+1)%self.n]*=-1\n",
" return State(l, self.sign*l[i%self.n])\n",
" def __str__(self):\n",
" '''Convert to human readable wave function'''\n",
" if self.sep_print:\n",
" ls=[tosign(i) for i in self.l2]\n",
" s=''.join(ls)\n",
" return \"%s|%s⟩⊗|%s⟩\"%(tosign(self.sign), s[:self.n//2], s[self.n//2:])\n",
" else:\n",
" ls=[tosign(i) for i in self.l]\n",
" s=''.join(ls)\n",
" return \"%s|%s⟩\"%(tosign(self.sign), s)\n",
" def __repr__(self):\n",
" return \"State({0}, {1})\".format(self.l, self.sign)\n",
" def __hash__(self):\n",
" return hash(self.l2)\n",
" def __eq__(self, rhs):\n",
" return self.l2==rhs.l2\n",
" def __lt__(self, rhs):\n",
" return self.l2