{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# HGSFP Graduate Days SS2019\n",
"\n",
"## Programming exercise 4: The AKLT model and matrix product states"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"# load standard libraries\n",
"\n",
"import scipy.sparse as sparse\n",
"import scipy.sparse.linalg as spla\n",
"import scipy.linalg as scla\n",
"import numpy as np\n",
"import numpy.linalg as npla\n",
"import matplotlib.pyplot as plt\n",
"from numpy import (array, pi, cos, sin, arctan, zeros, ones, size, sqrt, real, mod, append, arange)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Solving the AKLT model with exact diagonalization\n",
"\n",
"In this exercise we want to study a quantum many-body model for spins known as the AKLT model which was introduced in the 80's to explore the Haldane conjecture (see https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.59.799). It has a couple of remarkable features that will allow us to use it as playground for testing the basic ideas surrounding matrix product states. As additional practice on how to build general spin models and exact diagonalization, we will start by solving it here by numerical means and then compare the result to some theoretical predictions. You can use some of the code from exercise 1 as a basis but make sure to modify the operators as now we are working with spin 1! \n",
"\n",
"As mentioned, this is a spin 1 model and it lives on a one-dimensional chain with periodic boundary conditions (using the correct boundary condition is critical here) and the Hamiltonian is given by:\n",
"\n",
"$$\n",
"H=J\\sum_{i=0}^{N-1}\\left(\\frac{1}{3} +\\frac{1}{2}S^{(i)}\\cdot S^{(i+1)}+\\frac{1}{6}(S^{(i)}\\cdot S^{(i+1)})^2\\right)\n",
"$$\n",
"Remenber that, due to the periodic boundary conditions, the Nth spin is identified with 0th spin. $S^{(i)}$ denotes the vector of spin operators $(S_x^{(i)}, S_y^{(i)}, S_z^{(i)})$. It might be convenient to use the following representation for the spin their products:\n",
"$$\n",
"S^{(i)}\\cdot S^{(i+1)} = S_z^{(i)} S_z^{(i+1)}+\\frac{1}{2}\\left(S_+^{(i)}S_-^{(i+1)}+S_-^{(i)}S_+^{(i+1)}\\right)\n",
"$$\n",
"where the relevant spin 1 spin operators are $S_z=-|-1\\rangle\\langle-1| + |+1\\rangle\\langle+1|$, $S_+=\\sqrt{2}(|+1\\rangle\\langle 0| + |0\\rangle\\langle -1|)$ and $S_- = S_+^\\dagger$ (with $|s\\rangle$ denoting the basis states in the $S_z$ eigenbasis).\n",
"\n",
"Build the Hamiltonian in the standard product basis ($J$ is just a global energy scale and can be set to 1).\n",
"\n",
"First you can test your implementation by calculating the ground state energy and making sure it is zero as this is the theoretical prediction. Another test is the magnetization on the z direction which should also be zero.\n",
"\n",
"Once you are confident that your code is working you should compute the energy gap between ground and first excited state for a couple of system sizes $N$ and see how it behaves. Is the system gapped? This question is directly related to the Haldane conjecture.\n",
"\n",
"Finally, compute the correlation function $\\langle S_z^{(i)}S_z^{(i+r)} \\rangle$ as a function of $r$ and compare to the theoretical result:\n",
"$$\n",
"\\langle S_z^{(i)}S_z^{(i+r)}\\rangle \\propto \\left(\\frac{-1}{3}\\right)^r\n",
"$$\n",
"\n",
"It probably won't look so good due to the smallness of the atom numbers that exact diagonalization allows you to explore but you should get some agreement.\n",
"\n",
"\n",
"Optional: Investigate what happens for open boundary conditions and see if there is any qualitative difference."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### MPS description\n",
"\n",
"Now, finally, we will use the MPS machinery and explain why we chose to study the AKLT model (besides the fact that it is a pretty cool model :)). Usually for any given Hamiltonian it is necessary to apply a (complicated) variational procedure to find a good MPS aproximation for the ground state (as discussed in lecture 5) but the AKLT ground states is special in that it admits an exact MPS description so we can directly apply the tensor network techniques to it! The representation only requires bond dimension 2 and is given by the following 2x2 matrices:\n",
"$$\n",
"A_{+1}=\\sqrt{\\frac{2}{3}} \\sigma_+\\\\\n",
"A_{0}=-\\sqrt{\\frac{1}{3}} \\sigma_z\\\\\n",
"A_{-1}=-\\sqrt{\\frac{2}{3}} \\sigma_-\\\\\n",
"$$\n",
"\n",
"Show that this really gives the ground state by comparing it to the states you got from exact diagonalization. To do so you should use the expression for MPS ansatz to reconstruct the corresponding state in your basis\n",
"$$\n",
"|\\psi_{\\text{mps}}\\rangle = \\sum_{s_i} Tr(A_{s_0}A_{s_1}\\dots A_{s_{N-1}})|s_0 s_1 \\dots s_{N-1}\\rangle\n",
"$$\n",
"and compute the overlap $\\langle\\psi_{\\text{ed}}|\\psi_{\\text{mps}}\\rangle$ with the exact diagonalzation ground state. Of course, this is not very smart as we are using our efficiennt MPS representation to reconstruct the inefficient ED representation, but it is a good sanity check nonetheless. \n",
"\n",
"You might notice a small deviation on the overlap. This comes from the fact that the MPS state is not normalized and you can see this by computing the norm directly from the matrices:\n",
"$$\n",
"\\langle\\psi_{\\text{mps}}|\\psi_{\\text{mps}}\\rangle = Tr(E^n)\n",
"$$\n",
"where\n",
"$$\n",
"E = \\sum_s A_s\\otimes A_s^*\\\\\n",
"$$\n",
"is the local matrix corresponding to the identity operator. To speed up this calculation you can diagonalize E so that you only need to compute powers of the eigenvales and not the actual matrix. Show that the deviation from 1 is small and vanishes exponentially for large systems.\n",
"\n",
"Now, for the real benefits of the MPS, let's compute the correlation function $\\langle S_z^{(i)}S_z^{(i+r)}\\rangle$ we had already studied the exact diagonalization exercise above. This can be done for very large systems by simply replacing two E matrices in the expression for the norm with\n",
"$$\n",
"E_z = \\sum_{s,s'}\\langle s|S_z|s'\\rangle A_s\\otimes A_{s'}^*\n",
"$$\n",
"which is the local matrix for $S_z$. Think about the correct position where the $E_z$ should go and use this to compute the correlation function. Compare the results to the theoretical prediction mentioned in the first exercise.\n",
"\n",
"Optional: The AKLT model has a hidden order that manifests itself through the \"string operator\":\n",
"$$\n",
"\\langle S_z^{(i)}\\,\\exp\\left[\\sum_{i2$"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.0"
}
},
"nbformat": 4,
"nbformat_minor": 2
}