|
87 | 87 | "import matplotlib.pyplot as plt" |
88 | 88 | ] |
89 | 89 | }, |
90 | | - { |
91 | | - "cell_type": "code", |
92 | | - "execution_count": null, |
93 | | - "id": "f8ef0f85", |
94 | | - "metadata": {}, |
95 | | - "outputs": [], |
96 | | - "source": [ |
97 | | - "# If true, we use sampling points in (0, beta); reversing the array maps tau to beta - tau.\n", |
98 | | - "# If false, we use sampling points in (-beta/2, beta/2]; reversing the array maps tau to -tau\n", |
99 | | - "# only if the number of points is even (see ckio_calc below).\n", |
100 | | - "# sparse-ir defaults to use_positive_taus=True, which reproduces the sampling points of version 1.\n", |
101 | | - "use_positive_taus = True" |
102 | | - ] |
103 | | - }, |
104 | 90 | { |
105 | 91 | "cell_type": "markdown", |
106 | 92 | "id": "238e7d17", |
|
123 | 109 | "\n", |
124 | 110 | "T = 0.1 # temperature\n", |
125 | 111 | "beta = 1/T # inverse temperature\n", |
126 | | - "n = 0.85 # electron filling, here per spin per lattice site (n=1: half filling)\n", |
| 112 | + "n = 0.85 # electron filling per lattice site, summed over both spins (n=1: half filling)\n", |
127 | 113 | "U = 4 # Hubbard interaction\n", |
128 | 114 | "\n", |
129 | 115 | "### Numerical parameters\n", |
|
154 | 140 | "outputs": [], |
155 | 141 | "source": [ |
156 | 142 | "#### Initiate fermionic and bosonic IR basis objects\n", |
157 | | - "IR_basis_set = sparse_ir.FiniteTempBasisSet(beta, wmax, eps=IR_tol, use_positive_taus=use_positive_taus)\n", |
| 143 | + "IR_basis_set = sparse_ir.FiniteTempBasisSet(beta, wmax, eps=IR_tol)\n", |
158 | 144 | "\n", |
159 | 145 | "class Mesh:\n", |
160 | 146 | " \"\"\"\n", |
|
286 | 272 | " if sfc_check < self.sfc_tol:\n", |
287 | 273 | " print(\"FLEX loop converged at desired accuracy\")\n", |
288 | 274 | " break\n", |
289 | | - " print(\"FLEX loop finished\", \" mu = \", self.mu, \"n = \", self.calc_electron_density(self.mu))\n", |
290 | 275 | " \n", |
291 | 276 | " def loop(self):\n", |
292 | 277 | " \"\"\" FLEX loop \"\"\"\n", |
|
350 | 335 | "\n", |
351 | 336 | " def ckio_calc(self):\n", |
352 | 337 | " \"\"\" Calculate irreducible susciptibility chi0(iv,q) \"\"\"\n", |
353 | | - " if use_positive_taus:\n", |
354 | | - " # G(tau) * G(beta - tau)\n", |
355 | | - " ckio = self.grit * self.grit[::-1, :]\n", |
356 | | - " else:\n", |
357 | | - " # - G(tau) * G(- tau)\n", |
358 | | - " # Reversing maps tau to -tau only for an even number of points: for an odd number,\n", |
359 | | - " # the unfolded set (-beta/2, beta/2] contains beta/2 but not -beta/2.\n", |
360 | | - " tau = self.mesh.IR_basis_set.smpl_tau_f.sampling_points\n", |
361 | | - " assert np.allclose(tau[::-1], -tau)\n", |
362 | | - " ckio = - self.grit * self.grit[::-1, :]\n", |
| 338 | + " # chi0(tau, r) = -G(tau, r) G(-tau, -r) = G(tau, r) G(beta - tau, r) (inversion symmetry).\n", |
| 339 | + " # The default sampling times lie in (0, beta), so reversing grit gives G(beta - tau, r).\n", |
| 340 | + " ckio = self.grit * self.grit[::-1, :]\n", |
363 | 341 | "\n", |
364 | 342 | " # Fourier transform\n", |
365 | 343 | " ckio = self.mesh.r_to_k(ckio)\n", |
|
433 | 411 | "outputs": [], |
434 | 412 | "source": [ |
435 | 413 | "# initialize calculation\n", |
436 | | - "IR_basis_set = sparse_ir.FiniteTempBasisSet(beta, wmax, eps=IR_tol, use_positive_taus=use_positive_taus)\n", |
| 414 | + "IR_basis_set = sparse_ir.FiniteTempBasisSet(beta, wmax, eps=IR_tol)\n", |
437 | 415 | "mesh = Mesh(IR_basis_set, nk1, nk2)\n", |
438 | 416 | "solver = FLEXSolver(mesh, U, n, sigma_init=0, sfc_tol=sfc_tol, maxiter=maxiter, U_maxiter=U_maxiter, mix=mix)\n", |
439 | 417 | "\n", |
|
461 | 439 | "# plot 2D k-dependence of lowest Matsubara frequency of e.g. Green function\n", |
462 | 440 | "plt.pcolormesh(2*mesh.k1.reshape(nk1,nk2), 2*mesh.k2.reshape(nk1,nk2), np.real(solver.gkio[mesh.iw0_f].reshape(mesh.nk1,mesh.nk2)), shading='auto')\n", |
463 | 441 | "ax = plt.gca()\n", |
464 | | - "ax.set_xlabel('$k_x/\\pi$')\n", |
| 442 | + "ax.set_xlabel(r'$k_x/\\pi$')\n", |
465 | 443 | "ax.set_xlim([0,2])\n", |
466 | | - "ax.set_ylabel('$k_y/\\pi$')\n", |
| 444 | + "ax.set_ylabel(r'$k_y/\\pi$')\n", |
467 | 445 | "ax.set_ylim([0,2])\n", |
468 | 446 | "ax.set_aspect('equal')\n", |
469 | 447 | "ax.set_title(r'Re $G(k,\\mathrm{i}\\pi T)$')\n", |
|
481 | 459 | "# plot 2D k-dependence of lowest Matsubara frequency of e.g. chi0\n", |
482 | 460 | "plt.pcolormesh(2*mesh.k1.reshape(nk1,nk2), 2*mesh.k2.reshape(nk1,nk2), np.real(solver.ckio[mesh.iw0_b].reshape(mesh.nk1,mesh.nk2)), shading='auto')\n", |
483 | 461 | "ax = plt.gca()\n", |
484 | | - "ax.set_xlabel('$k_x/\\pi$')\n", |
| 462 | + "ax.set_xlabel(r'$k_x/\\pi$')\n", |
485 | 463 | "ax.set_xlim([0,2])\n", |
486 | | - "ax.set_ylabel('$k_y/\\pi$')\n", |
| 464 | + "ax.set_ylabel(r'$k_y/\\pi$')\n", |
487 | 465 | "ax.set_ylim([0,2])\n", |
488 | 466 | "ax.set_aspect('equal')\n", |
489 | 467 | "ax.set_title(r'Re $\\chi_0(k,\\mathrm{i}\\nu^\\mathrm{B}=0)$')\n", |
|
669 | 647 | "plt.figure()\n", |
670 | 648 | "plt.pcolormesh(2*mesh.k1.reshape(nk1,nk2), 2*mesh.k2.reshape(nk1,nk2), np.real(gap_solver.delta0.reshape(nk1,nk2)) / np.linalg.norm(gap_solver.delta0), cmap='RdBu', shading='auto')\n", |
671 | 649 | "ax = plt.gca()\n", |
672 | | - "ax.set_xlabel('$k_x/\\pi$')\n", |
| 650 | + "ax.set_xlabel(r'$k_x/\\pi$')\n", |
673 | 651 | "ax.set_xlim([0,2])\n", |
674 | | - "ax.set_ylabel('$k_y/\\pi$')\n", |
| 652 | + "ax.set_ylabel(r'$k_y/\\pi$')\n", |
675 | 653 | "ax.set_ylim([0,2])\n", |
676 | 654 | "ax.set_aspect('equal')\n", |
677 | 655 | "ax.set_title('$\\\\Delta^0_d(k)$')\n", |
|
680 | 658 | "plt.figure()\n", |
681 | 659 | "plt.pcolormesh(2*mesh.k1.reshape(nk1,nk2), 2*mesh.k2.reshape(nk1,nk2), np.real(gap_solver.delta[mesh.iw0_f].reshape(mesh.nk1,mesh.nk2)), cmap='RdBu', shading='auto')\n", |
682 | 660 | "ax = plt.gca()\n", |
683 | | - "ax.set_xlabel('$k_x/\\pi$')\n", |
| 661 | + "ax.set_xlabel(r'$k_x/\\pi$')\n", |
684 | 662 | "ax.set_xlim([0,2])\n", |
685 | | - "ax.set_ylabel('$k_y/\\pi$')\n", |
| 663 | + "ax.set_ylabel(r'$k_y/\\pi$')\n", |
686 | 664 | "ax.set_ylim([0,2])\n", |
687 | 665 | "ax.set_aspect('equal')\n", |
688 | 666 | "ax.set_title(r'$\\Delta_d(k,\\mathrm{i}\\pi T)$')\n", |
|
701 | 679 | "plt.figure()\n", |
702 | 680 | "plt.pcolormesh(2*mesh.k1.reshape(nk1,nk2), 2*mesh.k2.reshape(nk1,nk2), np.real(gap_solver.fkio[mesh.iw0_f].reshape(mesh.nk1,mesh.nk2)), cmap='RdBu', shading='auto')\n", |
703 | 681 | "ax = plt.gca()\n", |
704 | | - "ax.set_xlabel('$k_x/\\pi$')\n", |
| 682 | + "ax.set_xlabel(r'$k_x/\\pi$')\n", |
705 | 683 | "ax.set_xlim([0,2])\n", |
706 | | - "ax.set_ylabel('$k_y/\\pi$')\n", |
| 684 | + "ax.set_ylabel(r'$k_y/\\pi$')\n", |
707 | 685 | "ax.set_ylim([0,2])\n", |
708 | 686 | "ax.set_aspect('equal')\n", |
709 | 687 | "ax.set_title(r'Re $F(k,\\mathrm{i}\\pi T)$')\n", |
|
739 | 717 | "print('Initialization...')\n", |
740 | 718 | "# system parameters\n", |
741 | 719 | "t = 1 # hopping amplitude\n", |
742 | | - "n = 0.85 # electron filling, here per spin per lattice site (n=1: half filling)\n", |
| 720 | + "n = 0.85 # electron filling per lattice site, summed over both spins (n=1: half filling)\n", |
743 | 721 | "U = 4 # Hubbard interaction\n", |
744 | 722 | "\n", |
745 | 723 | "W = 8*t # bandwidth\n", |
|
758 | 736 | "\n", |
759 | 737 | "# initialize first IR basis set (no recalculation, just reevaluation afterwards)\n", |
760 | 738 | "beta_init = 1/T_values[0]\n", |
761 | | - "IR_basis_set = sparse_ir.FiniteTempBasisSet(beta_init, IR_Lambda/beta_init, eps=IR_tol, use_positive_taus=use_positive_taus)\n", |
| 739 | + "IR_basis_set = sparse_ir.FiniteTempBasisSet(beta_init, IR_Lambda/beta_init, eps=IR_tol)\n", |
762 | 740 | "\n", |
763 | 741 | "# set initial self_energy - will be set to previous calculation step afterwards\n", |
764 | 742 | "sigma_init = 0\n", |
|
774 | 752 | " beta = 1/T\n", |
775 | 753 | "\n", |
776 | 754 | " # initialize meshes\n", |
777 | | - " IR_basis_set = sparse_ir.FiniteTempBasisSet(beta, IR_Lambda/beta, eps=IR_tol, sve_result=IR_basis_set.sve_result, use_positive_taus=use_positive_taus)\n", |
| 755 | + " IR_basis_set = sparse_ir.FiniteTempBasisSet(beta, IR_Lambda/beta, eps=IR_tol, sve_result=IR_basis_set.sve_result)\n", |
778 | 756 | " mesh = Mesh(IR_basis_set, nk1, nk2)\n", |
779 | 757 | " \n", |
780 | 758 | " # calculate FLEX loop\n", |
|
821 | 799 | "f_ax1.plot(k_HSP, chi_s_HSP,'-')\n", |
822 | 800 | "f_ax1.set_xlim([0,2+np.sqrt(2)])\n", |
823 | 801 | "f_ax1.set_xticks([0,1,2,2+np.sqrt(2)])\n", |
824 | | - "f_ax1.set_xticklabels(['$\\Gamma$','X','M','$\\Gamma$'])\n", |
| 802 | + "f_ax1.set_xticklabels([r'$\\Gamma$','X','M',r'$\\Gamma$'])\n", |
825 | 803 | "f_ax1.set_ylim([0,26])\n", |
826 | 804 | "f_ax1.set_xlabel('')\n", |
827 | 805 | "f_ax1.set_ylabel('$\\\\chi_{\\\\mathrm{s}}(\\\\mathrm{i}\\\\nu^\\\\mathrm{B}=0,{\\\\bf{q}})$', fontsize=14)\n", |
828 | 806 | "f_ax1.grid()\n", |
829 | 807 | "\n", |
830 | 808 | "# second panel with T-dependence of lambda_d and 1/chi_s,max\n", |
831 | | - "f_ax2.plot(T_values, lam_T, '-x', label='$\\lambda_d$')\n", |
832 | | - "f_ax2.plot(T_values, 1/chiSmax_T, '-x', label='$1/\\chi_{\\mathrm{s},\\mathrm{max}}$')\n", |
| 809 | + "f_ax2.plot(T_values, lam_T, '-x', label=r'$\\lambda_d$')\n", |
| 810 | + "f_ax2.plot(T_values, 1/chiSmax_T, '-x', label=r'$1/\\chi_{\\mathrm{s},\\mathrm{max}}$')\n", |
833 | 811 | "f_ax2.set_xlim([0.01,0.08])\n", |
834 | 812 | "f_ax2.set_ylim([0,1])\n", |
835 | 813 | "f_ax2.set_xlabel('$T/t$', fontsize=14)\n", |
836 | | - "f_ax2.set_ylabel('$\\lambda_d$, $1/\\chi_{\\mathrm{s},\\mathrm{max}}$', fontsize=14)\n", |
| 814 | + "f_ax2.set_ylabel(r'$\\lambda_d$, $1/\\chi_{\\mathrm{s},\\mathrm{max}}$', fontsize=14)\n", |
837 | 815 | "f_ax2.legend()\n", |
838 | 816 | "f_ax2.grid()\n", |
839 | 817 | "plt.show()" |
|
0 commit comments