.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/statphys/lieb_liniger/plot_lieb_liniger_bose_gas.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_api_gallery_statphys_lieb_liniger_plot_lieb_liniger_bose_gas.py: The Lieb-Liniger Bose gas ========================= Lieb and Liniger (1963) solved :math:`N` bosons on a ring with a contact interaction :math:`2c\sum_{i 3], strong[gammas > 3], "--", color="firebrick", label="strong-coupling series") ax.axhline(tonks_girardeau_energy(), color="0.5", ls=":", label=r"Tonks-Girardeau $\pi^2/3$") ax.set_xlabel(r"$\gamma = c/n$") ax.set_ylabel(r"$e(\gamma) = E/(N n^2)$") ax.legend(fontsize=8) fig1.tight_layout() .. image-sg:: /api/gallery/statphys/lieb_liniger/images/sphx_glr_plot_lieb_liniger_bose_gas_001.png :alt: plot lieb liniger bose gas :srcset: /api/gallery/statphys/lieb_liniger/images/sphx_glr_plot_lieb_liniger_bose_gas_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 54-60 Rapidities: from a semicircle to a Fermi sea -------------------------------------------- With rapidities scaled to the Fermi rapidity :math:`q`, the density :math:`g(k/q)` is a semicircle at weak coupling and flattens to the free-fermion value :math:`1/(2\pi)` as :math:`\gamma\to\infty`. Each curve is normalized to unit area to compare shapes. .. GENERATED FROM PYTHON SOURCE LINES 60-71 .. code-block:: Python fig2, ax = plt.subplots(figsize=(6.5, 4.2)) for gamma, color in [(1e-3, "royalblue"), (0.1, "teal"), (1.0, "goldenrod"), (10.0, "darkorange"), (1e3, "firebrick")]: x, w, g = lieb_liniger_rapidity_density(lieb_liniger_coupling(gamma)) ax.plot(x, g / (w @ g), color=color, label=rf"$\gamma={gamma:g}$") xs = np.linspace(-1, 1, 201) ax.plot(xs, 2 / np.pi * np.sqrt(1 - xs**2), "k:", label="semicircle") ax.set_xlabel(r"$k/q$") ax.set_ylabel("normalized rapidity density") ax.legend(fontsize=8) fig2.tight_layout() .. image-sg:: /api/gallery/statphys/lieb_liniger/images/sphx_glr_plot_lieb_liniger_bose_gas_002.png :alt: plot lieb liniger bose gas :srcset: /api/gallery/statphys/lieb_liniger/images/sphx_glr_plot_lieb_liniger_bose_gas_002.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 72-78 Fermionization: the bosons stop meeting --------------------------------------- The probability of finding two bosons at the same point, :math:`g_2(0) = de/d\gamma`, falls from 1 (a condensate) to :math:`4\pi^2/(3\gamma^2)`: at large :math:`\gamma` the bosons avoid each other as if obeying Pauli exclusion. .. GENERATED FROM PYTHON SOURCE LINES 78-89 .. code-block:: Python g2_gammas = np.logspace(-2.5, 3, 25) g2 = np.array([lieb_liniger_pair_correlation(g) for g in g2_gammas]) fig3, ax = plt.subplots(figsize=(6.5, 4.2)) ax.loglog(g2_gammas, g2, "ko", mfc="none", label="exact") ax.loglog(g2_gammas[g2_gammas < 0.3], 1 - 2 * np.sqrt(g2_gammas[g2_gammas < 0.3]) / np.pi, "--", color="royalblue", label=r"$1-2\sqrt{\gamma}/\pi$") ax.loglog(g2_gammas[g2_gammas > 3], 4 * np.pi**2 / (3 * g2_gammas[g2_gammas > 3] ** 2), "--", color="firebrick", label=r"$4\pi^2/(3\gamma^2)$") ax.set_xlabel(r"$\gamma$") ax.set_ylabel(r"$g_2(0)$") ax.legend(fontsize=8) fig3.tight_layout() .. image-sg:: /api/gallery/statphys/lieb_liniger/images/sphx_glr_plot_lieb_liniger_bose_gas_003.png :alt: plot lieb liniger bose gas :srcset: /api/gallery/statphys/lieb_liniger/images/sphx_glr_plot_lieb_liniger_bose_gas_003.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 90-95 Finite rings converge to the thermodynamic limit ------------------------------------------------ Solving the Bethe equations for :math:`N` bosons on a ring of length :math:`L=N` (unit density, :math:`\gamma=1`) gives an energy per particle that approaches :math:`e(1)` as :math:`1/N^2`. .. GENERATED FROM PYTHON SOURCE LINES 95-108 .. code-block:: Python Ns = np.array([4, 8, 16, 32, 64, 128]) eN = np.array([np.sum(lieb_liniger_bethe_rapidities(N, float(N), 1.0) ** 2) / N for N in Ns]) e1 = lieb_liniger_energy(1.0) fig4, ax = plt.subplots(figsize=(6.5, 4.2)) ax.loglog(Ns, np.abs(eN - e1), "ko-", label=r"$|E_N/N - e(1)|$") ax.loglog(Ns, np.abs(eN[-1] - e1) * (Ns[-1] / Ns) ** 2, "--", color="0.5", label=r"$\propto N^{-2}$") ax.set_xlabel(r"$N$") ax.set_ylabel("finite-size error") ax.legend(fontsize=8) fig4.tight_layout() plt.show() print(f"e(1) = {e1:.10f}; Tonks-Girardeau pi^2/3 = {tonks_girardeau_energy():.10f}") .. image-sg:: /api/gallery/statphys/lieb_liniger/images/sphx_glr_plot_lieb_liniger_bose_gas_004.png :alt: plot lieb liniger bose gas :srcset: /api/gallery/statphys/lieb_liniger/images/sphx_glr_plot_lieb_liniger_bose_gas_004.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none e(1) = 0.6391512853; Tonks-Girardeau pi^2/3 = 3.2898681337 .. GENERATED FROM PYTHON SOURCE LINES 109-116 Check ----- The exact energy matches the Bogoliubov series at weak coupling and the strong-coupling series near the Tonks-Girardeau limit; finite rings with infinite coupling reproduce free fermions; :math:`g_2(0)` decreases monotonically to its fermionized limit; and the finite-size error falls as :math:`1/N^2`. .. GENERATED FROM PYTHON SOURCE LINES 116-125 .. code-block:: Python assert abs(e[0] - weak[0]) < 1e-9 assert abs(e[-1] - strong[-1]) < 1e-7 and e[-1] < tonks_girardeau_energy() assert np.all(np.diff(e) > 0) for N in (3, 6): k = lieb_liniger_bethe_rapidities(N, float(N), 1e12) assert abs(np.sum(k**2) / N - tonks_girardeau_energy(N)) < 1e-9 assert np.all(np.diff(g2) < 0) and abs(g2[-1] / (4 * np.pi**2 / 3e6) - 1) < 1e-2 ratios = np.abs(eN[:-1] - e1) / np.abs(eN[1:] - e1) assert np.all(np.abs(ratios[2:] - 4) < 0.1) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 6.828 seconds) .. _sphx_glr_download_api_gallery_statphys_lieb_liniger_plot_lieb_liniger_bose_gas.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_lieb_liniger_bose_gas.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_lieb_liniger_bose_gas.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_lieb_liniger_bose_gas.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_