.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/statphys/renormalization/plot_block_spin_rg_flow.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_renormalization_plot_block_spin_rg_flow.py: Kadanoff block-spin renormalization group flow ==================================================== Real-space renormalization group (RG) transformations reveal *why* critical phenomena are universal. Starting from an Ising configuration (:math:`H = -J \sum_{\langle i,j \rangle} s_i s_j`, :math:`s_i = \pm 1`) equilibrated at temperature :math:`T`, Kadanoff's construction repeatedly replaces each non-overlapping :math:`2\times2` block of spins by a single effective spin via majority rule, .. math:: s'_{I} = \mathrm{sign}\!\left(\sum_{i \,\in\, \text{block } I} s_i\right), with an exact tie broken by a fair coin flip -- mapping the lattice onto a smaller one that behaves as if sampled at some effective temperature :math:`T'`. Iterating this map drives almost any starting configuration to one of three fixed points: a fully ordered lattice (:math:`T \ll T_C`), a fully disordered one (:math:`T \gg T_C`), or -- exactly at :math:`T_C` -- a self-similar configuration that looks statistically the same at every coarse-graining step, tracked here via the order parameter :math:`|\langle s \rangle|`, the visual and quantitative signature of scale invariance at a critical point. .. GENERATED FROM PYTHON SOURCE LINES 26-35 .. code-block:: Python import matplotlib.pyplot as plt from physicskit.statphys.chapters.ising_lattice import Ising2D from physicskit.statphys.chapters.renormalization import BlockSpinRG from physicskit.statphys.visualizers.rg_render import plot_rg_flow T_C = Ising2D().T_C .. GENERATED FROM PYTHON SOURCE LINES 36-38 RG flow from three starting temperatures ---------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 38-48 .. code-block:: Python for T, label in [(0.5 * T_C, "T << T_C"), (T_C, "T = T_C"), (2.0 * T_C, "T >> T_C")]: rg = BlockSpinRG(L=64, T=T, J=1.0, n_equil_sweeps=400, seed=0) grids = rg.iterate(n_steps=4) orders = [rg.order_parameter(g) for g in grids] axes = plot_rg_flow(grids, titles=[f"L={g.shape[0]}\n|m|={m:.2f}" for g, m in zip(grids, orders)]) plt.gcf().suptitle(f"Block-spin RG flow, {label} = {T:.2f}") plt.tight_layout() plt.show() .. rst-class:: sphx-glr-horizontal * .. image-sg:: /api/gallery/statphys/renormalization/images/sphx_glr_plot_block_spin_rg_flow_001.png :alt: Block-spin RG flow, T << T_C = 1.13, L=64 |m|=1.00, L=32 |m|=1.00, L=16 |m|=1.00, L=8 |m|=1.00, L=4 |m|=1.00 :srcset: /api/gallery/statphys/renormalization/images/sphx_glr_plot_block_spin_rg_flow_001.png :class: sphx-glr-multi-img * .. image-sg:: /api/gallery/statphys/renormalization/images/sphx_glr_plot_block_spin_rg_flow_002.png :alt: Block-spin RG flow, T = T_C = 2.27, L=64 |m|=0.72, L=32 |m|=0.80, L=16 |m|=0.88, L=8 |m|=0.88, L=4 |m|=0.88 :srcset: /api/gallery/statphys/renormalization/images/sphx_glr_plot_block_spin_rg_flow_002.png :class: sphx-glr-multi-img * .. image-sg:: /api/gallery/statphys/renormalization/images/sphx_glr_plot_block_spin_rg_flow_003.png :alt: Block-spin RG flow, T >> T_C = 4.54, L=64 |m|=0.00, L=32 |m|=0.00, L=16 |m|=0.12, L=8 |m|=0.19, L=4 |m|=0.25 :srcset: /api/gallery/statphys/renormalization/images/sphx_glr_plot_block_spin_rg_flow_003.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.150 seconds) .. _sphx_glr_download_api_gallery_statphys_renormalization_plot_block_spin_rg_flow.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_block_spin_rg_flow.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_block_spin_rg_flow.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_block_spin_rg_flow.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_