{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Two-particle self consistency (TPSC)\n", "\n", "Now, we use TPRF to study the *two-particle self consistent (TPSC)* approximation explained in [the lecture notes](https://www.physique.usherbrooke.ca/tremblay/cours/phy-892/N-corps.pdf) of André-Marie Tremblay and in the following [review](https://arxiv.org/abs/1107.1534) to study the Hubbard model on the square lattice with nearest neighbour hopping. \n", "\n", "In TPSC, the vertices for charge and spin fluctuations are different but are kept local. Just like the momentum and frequency independent bare interaction $U$ in the Hubbard model. Having separate vertices for spin ($U_{sp}$) and charge ($U_{ch}$) allows TPSC to obey density conservations laws and the Pauli principle." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Theory\n", "\n", "In TPCS the spin and charge susceptibilities $\\chi_{sp}$ and $\\chi_{ch}$ are defined as\n", "\n", "$$ \\chi_{sp}(\\mathbf{q}, i\\omega_n) \\equiv \\frac{\\chi_0(\\mathbf{q}, i\\omega_n)}{1 - \\frac{U_{sp}}{2} \\chi_0(\\mathbf{q}, i\\omega_n)} \\, ,$$\n", "\n", "$$ \\chi_{ch}(\\mathbf{q}, i\\omega_n) \\equiv \\frac{\\chi_0(\\mathbf{q}, i\\omega_n)}{1 + \\frac{U_{ch}}{2} \\chi_0(\\mathbf{q}, i\\omega_n)} \\, . $$\n", "\n", "The verticies $U_{sp}$ and $U_{ch}$ are determined using two separate and cascaded sum rules. For the spin channel, $U_{sp}$ and $\\chi_{sp}$ can be determined combining the definition of $\\chi_{sp}$ above with the sum rule, \n", "\n", "$$\n", "\\chi_{sp}(\\mathbf{r} = 0, \\tau = \\beta) =\n", "\\left< (n_\\uparrow - n_\\downarrow)^2\\right>=n-2\\left< n_\\uparrow n_\\downarrow\\right> \\, ,\n", "$$\n", "\n", "where the equal-time equal-position susceptibility alternatively can be expressed as the momentum and frequency sum\n", "\n", "$$\n", "\\chi_{sp}(\\mathbf{r} = 0, \\tau = \\beta) =\n", "\\frac{T}{N}\\sum_{\\mathbf{q},i\\omega_n} \\chi_{sp}(\\mathbf{q}, i\\omega_n)\n", "\\, .\n", "$$\n", "\n", "The Pauli principle requires that $\\left< n_\\uparrow^2\\right>=\\left< n_\\uparrow\\right>$ since only a single fermion can occupy a given state. Substituting the TPSC value of the spin susceptibility, the double occupancy $\\left< n_\\uparrow n_\\downarrow\\right>$ and $U_{sp}$ can be determined from\n", "\n", "\\begin{equation}\n", "\\frac{T}{N}\\sum_{\\mathbf{q},i\\omega_n} \\frac{\\chi_0(\\mathbf{q},i\\omega_n)}{1-\\frac{U_{sp}}{2}\\chi_0(\\mathbf{q},i\\omega_n)}=n-2\\left< n_\\uparrow n_\\downarrow\\right>\n", "\\end{equation}\n", "\n", "using the ansatz\n", "\n", "\\begin{equation}\n", "U_{sp}\\left \\left=U\\left.\n", "\\end{equation}\n", "\n", "at fixed density $n \\equiv \\langle n_\\uparrow \\rangle + \\langle n_\\downarrow \\rangle$.\n", "\n", "With $U_{sp}$ known we now turn to $U_{ch}$ and determine it using a second conservation law and the Pauli principle for fermions. \n", "\n", "Given the double occupancy $\\left=\\frac{U_{sp}}{U} \\left \\left$, the charge vertex $U_{ch}$ can be obtained from\n", "\n", "$$\n", "\\frac{T}{N}\\sum_{\\mathbf{q},i\\omega_n} \n", "\\frac{\\chi_0(\\mathbf{q},i\\omega_n)}{1+\\frac{U_{ch}} {2}\\chi_0(\\mathbf{q},i\\omega_n)}=n+2\\left< n_\\uparrow n_\\downarrow\\right>-n^2.\n", "$$\n", "\n", "We will use a root finding algorithm in order to determine the value of $U_{sp}$ which makes $\\chi_{sp}$ obey the first relation and then determined $U_{ch}$ so that $\\chi_{ch}$ obeys the second conservation law." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2023-08-29T09:09:15.695625Z", "iopub.status.busy": "2023-08-29T09:09:15.695361Z", "iopub.status.idle": "2023-08-29T09:09:15.953959Z", "shell.execute_reply": "2023-08-29T09:09:15.953586Z" }, "scrolled": true }, "outputs": [], "source": [ "%matplotlib inline\n", "%config InlineBackend.figure_format = 'svg'\n", "from triqs.plot.mpl_interface import plt, oplot\n", "\n", "import numpy as np\n", "from triqs.gf import *" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Load the bare susceptibility $\\chi_0$ from the previous notebook" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2023-08-29T09:09:15.955982Z", "iopub.status.busy": "2023-08-29T09:09:15.955472Z", "iopub.status.idle": "2023-08-29T09:09:15.992187Z", "shell.execute_reply": "2023-08-29T09:09:15.991853Z" } }, "outputs": [], "source": [ "from h5 import HDFArchive\n", "\n", "with HDFArchive(\"chi0_wk.h5\", 'r') as R:\n", " chi0_wk = R['chi0_wk']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Behaviour of $U_{sp}$ and $U_{ch}$ vs. $U$\n", "\n", "Let's study the behaviour of $U_{sp}$ and $U_{ch}$ as we vary $U$. This will require us to solve the TPSC equations described above. Our aim is to reproduce the results from __[[Vilk and Tremblay, J. Phys. I France 7 (1997) 1309-1368]](https://jp1.journaldephysique.org/articles/jp1/abs/1997/11/jp1v7p1309/jp1v7p1309.html)__ __[[arXiv version]](https://arxiv.org/abs/cond-mat/9702188v3)__ and the figure:\n", "\n", "\"Drawing\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise 1:\n", "\n", "Define a function `solve_rpa(chi0_wk, U)` that\n", "computes the following quantity:\n", "\n", "\\begin{equation}\n", " \\chi_{RPA}[\\chi_0, U] \\equiv \\frac{\\chi_0(\\mathbf{q}, i\\omega_n)}\n", " {1 - \\frac{U}{2} \\chi_0(\\mathbf{q}, i\\omega_n)}\n", "\\end{equation}\n", "\n", "This function will be useful to obtain both the spin and the charge\n", "susceptibilities. Indeed we have that\n", "\n", "\\begin{equation}\n", " \\chi_{sp} = \\chi_{RPA}[\\chi_0 ,U_{sp}]\n", " \\qquad \n", " \\chi_{ch} = \\chi_{RPA}[\\chi_0,-U_{ch}]\n", "\\end{equation}\n", "\n", "**Hint**: use the `triq_trpf.lattice.solve_rpa_PH` routine introduced in the previous notebook." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "execution": { "iopub.execute_input": "2023-08-29T09:09:15.993724Z", "iopub.status.busy": "2023-08-29T09:09:15.993647Z", "iopub.status.idle": "2023-08-29T09:09:15.997003Z", "shell.execute_reply": "2023-08-29T09:09:15.996770Z" } }, "outputs": [], "source": [ "from triqs_tprf.lattice import solve_rpa_PH\n", "\n", "def solve_rpa(chi0_wk, U):\n", " I = np.ones([1, 1, 1, 1], dtype=complex)\n", " chi_wk = solve_rpa_PH(chi0_wk, U/2 * I)\n", " return chi_wk" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise 2:\n", "\n", "We will now solve the TPSC equation for $U_{sp}$.\n", "\n", "\\begin{equation}\n", "\\frac{T}{N}\\sum_{\\mathbf{q},i\\omega_n} \\chi_{sp}(\\mathbf{q},i\\omega_n) = n-2\\left< n_\\uparrow n_\\downarrow\\right> = n - 2\n", "\\frac{U_{sp}}{U} \\left \\left\n", "\\, ,\n", "\\end{equation}\n", "\n", "focusing on the unity density case $n=1$.\n", "\n", "* Check analytically that this equation always has exactly one solution for $U_{sp}$.\n", "* In what interval does $U_{sp}$ take its values?\n", "\n", "In order to find the value of $U_{sp}$ that solves the equation we will use the scipy root solver `scipy.optimize.brentq`. Your task is to complete the code below by:\n", "\n", "* defining the function `Usp_root` whose zero corresponds to the solution of the TPSC equation above.\n", "* defining the interval $[a,b]$ where `brentq` has to look for zeroes\n", "\n", "To our help we have the function `trace_chi` that computes the sum over momenta and Matsubara frequencies on the left hand side. \n", "\n", "Check that for $U=2$ the solution is given by $U_{sp} \\simeq 1.51$." ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "execution": { "iopub.execute_input": "2023-08-29T09:09:15.998370Z", "iopub.status.busy": "2023-08-29T09:09:15.998302Z", "iopub.status.idle": "2023-08-29T09:09:17.117636Z", "shell.execute_reply": "2023-08-29T09:09:17.117315Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1.5092181189127931\n" ] } ], "source": [ "def trace_chi(chi_wk):\n", " \"\"\"Compute the sum, \\sum_k \\sum_\\nu \\chi(k,\\nu)\"\"\" \n", " wmesh, kmesh = chi_wk.mesh.components\n", " chi_w = Gf(mesh=wmesh, target_shape=[])\n", " chi_w.data[:] = np.sum(np.squeeze(chi_wk.data), axis=1) / len(kmesh)\n", " return -chi_w.density().real\n", "\n", "def Usp_root(Usp, chi0_wk, n, U):\n", " \n", " # Write your code here\n", " \n", " tr_chi_sp = trace_chi(solve_rpa(chi0_wk, U=Usp))\n", " diff = tr_chi_sp + 0.5 * Usp/U * n**2 - n\n", " return diff\n", "\n", "# Write your code here\n", "\n", "U = 2.0\n", "n = 1.0\n", "a = 0\n", "b = 2 / chi0_wk(0, [np.pi, np.pi, 0]).real\n", "\n", "from scipy.optimize import brentq\n", "Usp = brentq(Usp_root, a, b, args=(chi0_wk, n, U), xtol=1e-2)\n", "print(Usp)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise 3:\n", "\n", "With the solution for $U_{sp}$ known it is now possible to solve the TPSC equation for $U_{ch}$:\n", "\n", "\\begin{equation}\n", "\\frac{T}{N}\\sum_{\\mathbf{q},i\\omega_n} \\chi_{ch}(\\mathbf{q},i\\omega_n)\n", "=n+2\\left< n_\\uparrow n_\\downarrow\\right>-n^2\n", "= n+2 \\frac{U_{sp}}{U} \\left \\left\n", "- n^2\n", "\\end{equation}\n", "\n", "For $U=2$, you should find $U_{ch} \\simeq 3.59$." ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "execution": { "iopub.execute_input": "2023-08-29T09:09:17.134676Z", "iopub.status.busy": "2023-08-29T09:09:17.134554Z", "iopub.status.idle": "2023-08-29T09:09:18.634087Z", "shell.execute_reply": "2023-08-29T09:09:18.633856Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "3.5918677213723913\n" ] } ], "source": [ "def Uch_root(Uch, chi0_wk, n, U, docc):\n", " \n", " # write your code here\n", " \n", " tr_chi = trace_chi(solve_rpa(chi0_wk, U=-Uch))\n", " diff = tr_chi - 2 * docc - n + n**2\n", " return diff\n", "\n", "docc = 0.25 * Usp / U * n**2\n", "a = 0\n", "b = 100\n", "Uch = brentq(Uch_root, a, b, args=(chi0_wk, n, U, docc), xtol=1e-2)\n", "print(Uch)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise 4:\n", "\n", "Combining the calculators for $U_{sp}$ and $U_{ch}$ from above, we can now define a function `solve_tpsc(chi0_wk, U, n)` that solves the TPSC equations for a given value of $U$ and $n$ and returns $U_{sp}$ and $U_{ch}$.\n", "\n", "Implement the function `solve_tpsc(chi0_wk, U, n)`" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "execution": { "iopub.execute_input": "2023-08-29T09:09:18.635577Z", "iopub.status.busy": "2023-08-29T09:09:18.635502Z", "iopub.status.idle": "2023-08-29T09:09:21.033984Z", "shell.execute_reply": "2023-08-29T09:09:21.033731Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(1.5092181189127931, 3.5918677213723913, 0.18865226486409914, 2.778901915273313)\n" ] } ], "source": [ "# Write your code here\n", "\n", "def solve_tpsc(chi0_wk, U, n):\n", " Uc = 2/np.squeeze(chi0_wk(0, [np.pi, np.pi, 0])).real\n", " Usp = brentq(Usp_root, 0, Uc, args=(chi0_wk, n, U), xtol=1e-2)\n", " docc = 0.25 * Usp / U * n**2\n", " Uch = brentq(Uch_root, 0, 100, args=(chi0_wk, n, U, docc), xtol=1e-2)\n", " return Usp, Uch, docc, Uc\n", "\n", "print(solve_tpsc(chi0_wk, 2., 1.))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise 5:\n", "\n", "Use the `solve_tpsc` function to study $U_{sp}$ and $U_{ch}$ as a function of $U$. Scan different values of $U$ between 0.3 and 5 and plot the result, comparing to the figure shown above. (There, the density is always $n=1$.)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "execution": { "iopub.execute_input": "2023-08-29T09:09:21.035381Z", "iopub.status.busy": "2023-08-29T09:09:21.035305Z", "iopub.status.idle": "2023-08-29T09:09:40.184226Z", "shell.execute_reply": "2023-08-29T09:09:40.183937Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "| n | U | Usp | Uch | docc |\n", "-------------------------------------------------------------------\n", "| 1.0000E+00 | 3.0000E-01 | 2.8960E-01 | 3.2410E-01 | 2.4133E-01 |\n", "| 1.0000E+00 | 5.0000E-01 | 4.6960E-01 | 6.0074E-01 | 2.3480E-01 |\n", "| 1.0000E+00 | 7.0000E-01 | 6.4299E-01 | 8.4181E-01 | 2.2964E-01 |\n", "| 1.0000E+00 | 9.0000E-01 | 8.0435E-01 | 1.1509E+00 | 2.2343E-01 |\n", "| 1.0000E+00 | 1.0000E+00 | 8.8118E-01 | 1.3194E+00 | 2.2029E-01 |\n", "| 1.0000E+00 | 2.0000E+00 | 1.5092E+00 | 3.5919E+00 | 1.8865E-01 |\n", "| 1.0000E+00 | 3.0000E+00 | 1.9155E+00 | 7.1248E+00 | 1.5962E-01 |\n", "| 1.0000E+00 | 4.0000E+00 | 2.1660E+00 | 1.2127E+01 | 1.3538E-01 |\n", "| 1.0000E+00 | 5.0000E+00 | 2.3187E+00 | 1.8718E+01 | 1.1594E-01 |\n" ] } ], "source": [ "# Write your code here\n", "\n", "n = 1.0\n", "\n", "# Initializes a table to store the results\n", "U_vec = np.concatenate((np.arange(0.3, 1., 0.2), np.arange(1., 6., 1.))) \n", "Usp_vec, Uch_vec, docc_vec = [np.zeros_like(U_vec) for x in range(3)]\n", "\n", "# Printing the header of the table\n", "print(''.join('| %-11s' % s for s in ['n', 'U', 'Usp', 'Uch', 'docc']), '|')\n", "print('-'*67)\n", "\n", "# Loop over the different values of bare U\n", "for idx, U in enumerate(U_vec):\n", " Usp, Uch, docc, Uc = solve_tpsc(chi0_wk, U, n)\n", " Usp_vec[idx], Uch_vec[idx], docc_vec[idx] = Usp, Uch, docc\n", " print(''.join('| %4.4E ' % x for x in [n, U, Usp, Uch, docc]), '|')" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "execution": { "iopub.execute_input": "2023-08-29T09:09:40.185603Z", "iopub.status.busy": "2023-08-29T09:09:40.185528Z", "iopub.status.idle": "2023-08-29T09:09:40.253405Z", "shell.execute_reply": "2023-08-29T09:09:40.253170Z" } }, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", " \n", " \n", " \n", " \n", " 2023-08-29T11:09:40.228139\n", " image/svg+xml\n", " \n", " \n", " Matplotlib v3.7.1, https://matplotlib.org/\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "\n" ], "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from matplotlib.image import imread\n", "\n", "# Some manual adjustements here to overlay the original figure. May change from one\n", "# machine to another\n", "im = imread(\"imgs/Fig2.png\")\n", "plt.imshow(im, extent=(-0.45, 5.35, -3, 20.5), aspect='auto')\n", "plt.plot([0,5,5,0,0],[0,0,20,20,0],'-r')\n", "\n", "plt.plot(U_vec, Usp_vec, 'o', label=r'$U_{sp}$', alpha=0.5, lw=2)\n", "plt.plot(U_vec, Uch_vec, 'o', label=r'$U_{ch}$', alpha=0.5, lw=2)\n", "\n", "plt.axis('off');" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Note: weakness of RPA\n", "\n", "Given the above sum rules, note that in TPSC the following sum-rule, a consequence of the Pauli principle, is satisfied:\n", "\n", "\\begin{equation}\n", "2\\frac{T}{N}\\sum_{\\mathbf{q},iq_n} \\left (\\frac{\\chi_0(\\mathbf{q},iq_n)}{1-\\frac{U_{sp}}{2}\\chi_0(\\mathbf{q},iq_n)}+\\frac{\\chi_0(\\mathbf{q},iq_n)}{1+\\frac{U_{ch}}{2}\\chi_0(\\mathbf{q},iq_n)}\\right)=2n-n^2.\n", "\\end{equation}\n", "\n", "Note that the right-hand side is independent of interactions.\n", "\n", "In RPA the left hand side of the above equation takes the form\n", "\n", "\\begin{equation}\n", "\\frac{T}{N}\\sum_{\\mathbf{q},iq_n} \\left (\\frac{\\chi_0(\\mathbf{q},iq_n)}{1-\\frac{U}{2}\\chi_0(\\mathbf{q},iq_n)}+\\frac{\\chi_0(\\mathbf{q},iq_n)}{1+\\frac{U}{2}\\chi_0(\\mathbf{q},iq_n)}\\right)\n", "\\end{equation}\n", "\n", "Note that the bare $U$ enters in both denominators. \n", "\n", "Study the violation of this sum rule by RPA by plotting the RPA expression as a function of $U$." ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "execution": { "iopub.execute_input": "2023-08-29T09:09:40.254866Z", "iopub.status.busy": "2023-08-29T09:09:40.254776Z", "iopub.status.idle": "2023-08-29T09:09:43.349367Z", "shell.execute_reply": "2023-08-29T09:09:43.349107Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "| U | sum_chi | 2n-n*n |\n", "-----------------------------------------\n", "| 0.0000E+00 | 9.9935E-01 | 1.0000E+00 |\n", "| 2.5000E-01 | 9.9969E-01 | 1.0000E+00 |\n", "| 5.0000E-01 | 1.0007E+00 | 1.0000E+00 |\n", "| 7.5000E-01 | 1.0024E+00 | 1.0000E+00 |\n", "| 1.0000E+00 | 1.0048E+00 | 1.0000E+00 |\n", "| 1.2500E+00 | 1.0079E+00 | 1.0000E+00 |\n", "| 1.5000E+00 | 1.0118E+00 | 1.0000E+00 |\n", "| 1.7500E+00 | 1.0166E+00 | 1.0000E+00 |\n", "| 2.0000E+00 | 1.0222E+00 | 1.0000E+00 |\n", "| 2.2500E+00 | 1.0287E+00 | 1.0000E+00 |\n" ] } ], "source": [ "# Write your code here\n", "\n", "n = 1.0\n", "U_vec = np.arange(0., 2.5, 0.25)\n", "sum_chi_vec = np.zeros_like(U_vec)\n", "\n", "wmesh, kmesh = chi0_wk.mesh.components\n", "\n", "print(''.join('| %-11s' % s for s in ['U', 'sum_chi', '2n-n*n']), '|')\n", "print('-'*41)\n", "\n", "for idx, U in enumerate(U_vec):\n", " sum_chi = solve_rpa(chi0_wk, +0.5*U) + solve_rpa(chi0_wk, -0.5*U)\n", " sum_chi = trace_chi(sum_chi)\n", " sum_chi_vec[idx] = sum_chi.real\n", " print(''.join('| %4.4E ' % x for x in [U, sum_chi.real, 2*n-n**2]), '|')" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "execution": { "iopub.execute_input": "2023-08-29T09:09:43.350697Z", "iopub.status.busy": "2023-08-29T09:09:43.350625Z", "iopub.status.idle": "2023-08-29T09:09:43.476293Z", "shell.execute_reply": "2023-08-29T09:09:43.476053Z" } }, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", " \n", " \n", " \n", " \n", " 2023-08-29T11:09:43.440362\n", " image/svg+xml\n", " \n", " \n", " Matplotlib v3.7.1, https://matplotlib.org/\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "\n" ], "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "plt.plot(U_vec, sum_chi_vec, '.-', label=r'Tr[$\\chi_{ch} + \\chi_{sp}$]')\n", "plt.plot(U_vec, 0*U_vec + 2*n - n**2, 'k-', lw=0.5, label=r'$2n-n^2$')\n", "plt.xlabel(r'$U$')\n", "plt.legend();" ] } ], "metadata": { "@webio": { "lastCommId": null, "lastKernelId": null }, "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.11.5" } }, "nbformat": 4, "nbformat_minor": 4 }