2
0
mirror of https://github.com/LCPQ/DEHam synced 2024-07-30 09:04:19 +02:00
DEHam/notebooks/t_J_Model.ipynb

508 lines
44 KiB
Plaintext
Raw Normal View History

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 1. t-J Model"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"-----"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 1. t-J Hamiltonian"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### a. Basis"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The $t-J$ Hamiltonian with a S=1/2 spin-model is constructed in a basis of $\\mathcal{R}^3$ given by the vector B as follows:\n",
"\n",
"$$\n",
"B=\n",
" \\begin{bmatrix}\n",
" 0 \\\\\n",
" \\uparrow \\\\\n",
" \\downarrow\n",
" \\end{bmatrix}\n",
"$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### b.) Operators"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The Hamiltonian is constructed using two types of operators.\n",
"\n",
"1. The particle creation and annihilation operators $\\hat{C}^\\dagger,\\hat{C}$\n",
"2. The spin ladder operators $\\hat{S}^+, \\hat{S}^-, \\hat{S}^z$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The matrix form of the five operators in the above basis is given as follows:\n",
"\n",
"$$\n",
"\\hat{C}^{\\dagger}_{\\uparrow}= \\left( \\hat{C}_{\\uparrow} \\right)^\\dagger=\n",
" \\begin{bmatrix}\n",
" 0 & 0 & 0 \\\\\n",
" 1 & 0 & 0 \\\\\n",
" 0 & 0 & 0\n",
" \\end{bmatrix}\n",
"$$\n",
"\n",
"$$\n",
"\\hat{C}^{\\dagger}_{\\downarrow}= \\left( \\hat{C}_{\\downarrow} \\right)^\\dagger=\n",
" \\begin{bmatrix}\n",
" 0 & 0 & 0 \\\\\n",
" 0 & 0 & 0 \\\\\n",
" 1 & 0 & 0\n",
" \\end{bmatrix}\n",
"$$\n",
"\n",
"$$\n",
"\\hat{S}^{z}\\ \\ \\ \\ =\\ \\ \\ \\ \\ \n",
" \\begin{bmatrix}\n",
" 0 & 0 & 0 \\\\\n",
" 0 & \\frac{1}{2} & 0 \\\\\n",
" 0 & 0 & -\\frac{1}{2}\n",
" \\end{bmatrix}\n",
"$$\n",
"\n",
"$$\n",
"\\hat{S}^{+}_{\\downarrow}= \\left( \\hat{S}^- \\right)^\\dagger=\n",
" \\begin{bmatrix}\n",
" 0 & 0 & 0 \\\\\n",
" 0 & 0 & 0 \\\\\n",
" 0 & 1 & 0\n",
" \\end{bmatrix}\n",
"$$\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### c.) Hamiltonian "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Nearest Neighbor coupling**\n",
"\n",
"The $t-J$ Hamiltonian is written in the above basis with the above five operators and the two parameters $t$ which governs the kinetic energy of the particles and the magnetic-coupling parameter $J$ which governs the coupling of the localized spins on neighboring sites.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$$\n",
"\\hat{H_{t-J}} = \\sum^{N-1}_i \\left\\{ t_{i,i+1} \\sum_{\\sigma} \\left(\\hat{C}^{\\dagger}_{\\sigma,i}\\cdot\\hat{C}_{\\sigma,i+1} + h.c. \\right) + J_{i,i+1} \\left( \\frac{\\hat{S}^+_{i}\\cdot\\hat{S}^-_{i+1} + \\hat{S}^-_{i}\\cdot\\hat{S}^+_{i+1}}{2} + \\hat{S}^z_i\\cdot\\hat{S}^z_{i+1} \\right)\\right\\}\n",
"$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$h.c.$ stands for Hermitian conjugate."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 2. 2D Lattice"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"----"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 1.) Labeling\n",
"Here a 4x4 lattice is shown with periodic boundary conditions where each site and bond is labelled."
]
},
{
"cell_type": "code",
"execution_count": 128,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAb4AAAEuCAYAAADx63eqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nOydd3gUVffHv7vZtE0DFBIISegEUulRlNASqjQRadIRxYpI8JWuiAKvNFGKSBGQJgi8NKWDkRK60gktgUBIQuqmbfb8/rim7yabPNmdyW/P53n2YXdm1v36zcyce889c6+CiAgMwzAMYyEopRbAMAzDMOaEAx/DMAxjUXDgYxiGYSwKDnwMwzCMRcGBj2EYhrEoOPAxDMMwFgUHPoZhGMai4MDHMAzDWBQc+BiGYRiLggMfwzAMY1Fw4GMYhmEsCg58DMMwjEXBgY9hGIaxKDjwMQzDMBYFBz6GYRjGouDAxzAMw1gUHPgYhmEYi4IDH8MwDGNRcOBjGIZhLAoOfAzDMIxFwYGPYRiGsSg48DEMwzAWBQc+hmEYxqLgwMcwDMNYFBz4GIZhGIuCAx/DMAxjUXDgYxiGYSwKDnwMwzCMRcGBr5Kg0WikllApYd/KB/tWPti3ygEHvkqCVquVWkKlhH0rH+xb+WDfKgcKIiKpRTAMwzCMueAeH8MwDGNRcOBjGIZhLAoOfAzDMIxFwYGPYRiGsSg48MmQK1eu5L3Pzs7G7Nmz0atXL3z++edcLl0CS5cuRVxcHADgzp07aNeuHapUqYI2bdrg77//llidfOnXrx82bNiA1NRUqaVUKu7evYtRo0Zh6tSpSE1NxdixY+Hr64s33ngD9+/fl1oeUwIc+GTIiBEj8t5/9tlnuHPnDiZOnIj09HS888470gmTOcuWLcOLL74IAPjoo48wYcIEJCYmYu7cuexbCZw5cwY7d+6Ep6cnBgwYgN9++w1ZWVlSy5I9I0aMQKtWreDo6IigoCB4e3tj//796N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Go159BagqG9ERDt27KDBgweb/LfHjSNSqYy3zcqKaPx4orS0/G0vvkik1ZpcajH0+TZnzhx65513TP/jffqIQGeMcfv3E3XrRnTvXn7gA4jq1yfS6UyvtQAFPXv99dfp0qVL5OXlZdGBj1OdMmDdOsMZkBo1xCMMV6+W/N+wtgb27694bSVx//59XLx4EW2kGvDZsEGkOYtSkmnt2hXerlQCx46ZTKI+DPm2evVqdOvWzeS/v22b/uIpfbY9fy4s/u47UZ+RS2ameATCnBT1bcqUKfDw8MDGjRvxxRdfmPbHiYA9e/SPIxc1rn9/YZC+C/LxYzEubSYKerZr1y64u7sjICDAbL8vVzjwyQBD4yUqlXj0bN06UYtREllZYozQXKSmpuL111/HokWLpJumKSGh+LaSTPPzA6ZPByZNyt+m05nVOEO+ffXVV1CpVBgyZIjJNSQnF99myLaqVcWzpO+/L4ayclEqpT/fvvrqK0RFRWHIkCFYunSpaQUYapkWNc7RUbQQPvpI//HW1mYzrqBnKpUKc+bMMX0DobIgdZdTH/PnzycAFvS6WyxzolAQbdpEtHev/rRU0VQnkEnAxArVtXbtWr1/n6ysLAoNDaVvv/222D5Dqc6kpCRq3LhxhepLKItp9esTRUcTDR1aaHsyQMMr+O9ZNBVXmm9r1qyhoKAgSktLK/YdjUZD1apVq+DzLbtM51ruMXFxRNWr5257TkCPCtV19OjRMp9vREQPHjwgHx+fQtvS0tIqVJsTQJnGnG///S/RtGn5xxRJdT4HqHUFn2///PNPqZ5duXKFqlevTl5eXuTl5UVWVlbk4eFBMTExhb4XExNTodrq1q1LycnJev9uUiLLwGdpBAYWv9G
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import matplotlib as mplt\n",
"import networkx as nx\n",
"import numpy as np\n",
2020-03-17 10:57:10 +01:00
"import matplotlib.pyplot as plt\n",
"\n",
"Lx = 4\n",
"Ly = 6\n",
2020-03-17 10:57:10 +01:00
"#fig = plt.figure()\n",
"#draw2DLattice(Lx,Ly,fig)\n",
"draw2DLattice(Lx,Ly)\n",
"#fig.savefig(\"/tmp/graph.png\",dpi=1000)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 2.) Generating input file \n",
"\n",
"In this work, we will be using the [DEHam](https://github.com/v1j4y/DEHam) code to solve the Hamiltonian using Exact Diagonalization method. \n",
"\n",
"The input file for the code is as follows:\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
" 1. The DEHam program requires an input file which \n",
" has the topology of the Hamiltonian and the various parameters\n",
" as explained below in a sample inputfile:\n",
"\n",
"```python\n",
"8 \t\t\t\t\t\t\t\t# The number of orbitals (total)\n",
"1 \t\t\t\t\t\t\t\t# The largest number of non-zero elements per row (Multiple of Ndet)\n",
"1 \t\t\t\t\t\t\t\t# The total number of processors used in parallel (Multiple of Ndet)\n",
"1 \t\t\t\t\t\t\t\t# The number of holes\n",
"0 \t\t\t\t\t\t\t\t# The isz (ms-1/2) value\n",
"true \t# Restrict the hole to the 1'st (i.e. half of natom) Family of states. *false* for no restrictions\n",
"1,2,3,1,2,3,4,5,6,7\t\t\t\t\t# (L1) The topology of the system is specified here\n",
"2,3,4,8,7,6,5,6,7,8\t\t\t\t\t# (L2) first and second line contain the two sites linked\n",
"1,1,1,2,2,2,2,3,3,3\t\t\t\t\t# (ltype) third line contains the type of link (1 for t or J, 2 for K and 3 for none)\n",
".1430,-0.20,0.0000\t\t\t\t\t# The three types of links this line gives Jz, Kz\n",
".1430,-0.20,0.0000\t\t\t\t\t# The three types of links this line gives Jx,y; Kx,y\n",
"-1.00,0.0,0.00\t\t\t\t\t\t# This line gives t(i,i+1), t(i,i+2), t(i,i+3)\n",
"0.,0.,0.,0.,0.,0.,0.,0.,0. \t\t # Energy of each orbital + additional energy\n",
"2 \t\t\t\t# The total number of roots\n",
"1 \t\t\t\t# I The position of the first\n",
"1 \t\t\t\t# I SBox\n",
"1 \t\t\t\t# I\n",
"1 \t\t\t\t# I\n",
"1 \t\t\t\t# II The positions of the second\n",
"1 \t\t\t\t# II SBox\n",
"1 \t\t\t\t# II\n",
"1 \t\t\t\t# II\n",
"1 \t\t\t\t# III\n",
"1 \t\t\t\t# III The positions of the third\n",
"1 \t\t\t\t# III SBox\n",
"1 \t\t\t\t# III\n",
"1 \t\t\t\t# positio of the hole\n",
"0 \t\t\t\t# fix the position of the first hole during the CI\n",
"0 \t\t\t\t# fix the position of the second hole during the CI\n",
"0 \t\t\t\t# Print the wavefunction. It is stored in the FIL666 file after the run\n",
"```\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### a.) Script for $t-J$ input file"
]
},
{
"cell_type": "code",
"execution_count": 130,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]\n",
"[2, 3, 4, 1, 6, 7, 8, 5, 10, 11, 12, 9, 14, 15, 16, 13, 18, 19, 20, 17, 22, 23, 24, 21, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 1, 2, 3, 4]\n",
"[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]\n",
"48\n"
]
}
],
"source": [
"l1, l2, ltype = getInput(Lx,Ly)\n",
"print(l1)\n",
"print(l2)\n",
"print(ltype)\n",
"print(len(l1))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"------"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 3.) Misc"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 1. Draw Lattice"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"\"\"\"\n",
"Function that draws a 2D Lattice\n",
"\"\"\"\n",
"def draw2DLattice(Lx,Ly):\n",
" n=Lx+2\n",
" m=Ly+2\n",
"\n",
" G = nx.grid_2d_graph(n,m) # Lx, Ly grid\n",
"\n",
" pos = dict( (n, n) for n in G.nodes() );\n",
" #labels = Dict( ((i, j), i + (Ly-j) * (Lx+1) ) for (i,j) in G.nodes() );\n",
" #edges=Dict()\n",
" #for (i,edge) in enumerate(G.edges)\n",
" # edges[edge]=i\n",
" # print(i,\"\\t\",edge,\"\\n\")\n",
" #end\n",
"\n",
"\n",
" for j in range(0,m-1):\n",
" G.remove_edge((0,j),(0,j+1))\n",
" G.remove_edge((n-1,j),(n-1,j+1))\n",
"\n",
" for i in range(0,n-1):\n",
" G.remove_edge((i,0),(i+1,0))\n",
" G.remove_edge((i,m-1),(i+1,m-1))\n",
"\n",
"\n",
"\n",
" edgescenter = dict()\n",
" countedge = 1\n",
" for j in range(1,m-1):\n",
" for i in range(1,n-1):\n",
" edgescenter[((i,j),(i+1,j))] = countedge\n",
" countedge += 1\n",
"\n",
"\n",
" for j in range(1,m-1):\n",
" for i in range(1,n-1):\n",
" edgescenter[((i,j),(i,j+1))] = countedge\n",
" countedge += 1\n",
"\n",
"\n",
" labelscenter = dict()\n",
" countlabels = 1\n",
" for j in range(1,m-1):\n",
" for i in range(1,n-1):\n",
" labelscenter[(i,j)]=countlabels\n",
" countlabels+=1\n",
"\n",
"\n",
" color_map=[]\n",
" countcolor=0\n",
" for i in range(0,n):\n",
" for j in range(0,m):\n",
" if i==0 or j==0 or i==n-1 or j==m-1:\n",
" color_map.append(\"white\")\n",
" else:\n",
" if(countcolor%2 == 0):\n",
" color_map.append(\"blue\")\n",
" else:\n",
" color_map.append(\"red\")\n",
" countcolor+=1\n",
" countcolor+=1\n",
"\n",
"\n",
2020-03-17 10:57:10 +01:00
"# nx.draw(G, pos=pos, labels=labelscenter, node_color=color_map, font_color=\"white\", ax=fig.add_subplot(111));\n",
"# nx.draw_networkx_edge_labels(G,pos,edge_labels=edgescenter,font_color=\"black\", ax=fig.add_subplot(111));\n",
" nx.draw(G, pos=pos, labels=labelscenter, node_color=color_map, font_color=\"white\");\n",
" nx.draw_networkx_edge_labels(G,pos,edge_labels=edgescenter,font_color=\"black\");\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 2. Generate Input"
]
},
{
"cell_type": "code",
"execution_count": 116,
"metadata": {},
"outputs": [],
"source": [
"\"\"\"\n",
"Function that generates the input\n",
"\"\"\"\n",
"def getInput(Lx,Ly):\n",
" n=Lx+2\n",
" m=Ly+2\n",
"\n",
"\n",
" labelscenter = dict()\n",
" countlabels = 1\n",
" for j in range(1,m-1):\n",
" for i in range(1,n-1):\n",
" labelscenter[(i,j)]=countlabels\n",
" countlabels+=1\n",
"# print(labelscenter)\n",
" edgescenter = dict()\n",
" countedge = 1\n",
" for j in range(1,m-1):\n",
" for i in range(1,n-1):\n",
" edgescenter[((i,j),(i+1,j))] = countedge\n",
" countedge += 1\n",
" for j in range(1,m-1):\n",
" for i in range(1,n-1):\n",
" edgescenter[((i,j),(i,j+1))] = countedge\n",
" countedge += 1\n",
"\n",
"# print(edgescenter)\n",
" l1 = []\n",
" l2 = []\n",
" itype = [1 for x in range(0,len(edgescenter))]\n",
" \n",
" for x in edgescenter:\n",
"# print(x[0],\"\\t\",x[1])\n",
"# print(l1)\n",
"# print(l2)\n",
" if Lx + 1 not in x[1] or Ly + 1 not in x[1]:\n",
"# print(\"-->\",x[1])\n",
" l1.append(labelscenter[x[0]])\n",
"# l2.append(labelscenter[x[1]])\n",
" if x[1][0] > Lx and x[1][1] <= Ly:\n",
" l2.append(labelscenter[(x[1][0]-Lx,x[1][1])])\n",
" elif x[1][0] <= Lx and x[1][1] > Ly:\n",
" l2.append(labelscenter[(x[1][0],x[1][1]-Ly)])\n",
" elif x[1][0] > Lx and x[1][1] > Ly:\n",
" l2.append(labelscenter[(x[1][0]-Lx,x[1][1]-Ly)])\n",
" else:\n",
" l2.append(labelscenter[x[1]])\n",
" else:\n",
" l1.append(labelscenter[x[0]])\n",
" if x[1][0] > Lx:\n",
" l2.append(labelscenter[(x[1][0]-Lx,x[1][1])])\n",
" elif x[1][1] > Ly:\n",
" l2.append(labelscenter[(x[1][0],x[1][1]-Ly)])\n",
"\n",
"# print(l1,\"\\n\")\n",
"# print(l2,\"\\n\")\n",
"# print(itype,\"\\n\")\n",
" return l1,l2,itype"
]
},
{
"cell_type": "code",
"execution_count": 117,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"([1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6],\n",
" [2, 1, 4, 3, 6, 5, 3, 4, 5, 6, 1, 2],\n",
" [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])"
]
},
"execution_count": 117,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"getInput(2,3)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"header=r\"\"\"\n",
"\n",
"\"\"\""
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python3",
"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.3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}