quant-met 0.0.23__py3-none-any.whl → 0.0.25__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- quant_met/cli/_utils.py +8 -4
- quant_met/cli/dmft.py +24 -19
- quant_met/dmft/dmft_loop.py +25 -36
- quant_met/dmft/utils.py +109 -0
- quant_met/mean_field/hamiltonians/base_hamiltonian.py +1 -1
- quant_met/mean_field/hamiltonians/dressed_graphene.py +7 -3
- quant_met/mean_field/search_crit_temp.py +9 -7
- {quant_met-0.0.23.dist-info → quant_met-0.0.25.dist-info}/METADATA +1 -1
- {quant_met-0.0.23.dist-info → quant_met-0.0.25.dist-info}/RECORD +12 -12
- {quant_met-0.0.23.dist-info → quant_met-0.0.25.dist-info}/WHEEL +0 -0
- {quant_met-0.0.23.dist-info → quant_met-0.0.25.dist-info}/entry_points.txt +0 -0
- {quant_met-0.0.23.dist-info → quant_met-0.0.25.dist-info}/licenses/LICENSE.txt +0 -0
    
        quant_met/cli/_utils.py
    CHANGED
    
    | @@ -41,7 +41,11 @@ def _tbl_factory(h: BaseHamiltonian[GenericParameters]) -> TBLattice: | |
| 41 41 | 
             
                    0.5 * lattice_constant * np.array([1, np.sqrt(3), 0]),
         | 
| 42 42 | 
             
                    0.5 * lattice_constant * np.array([1, -np.sqrt(3), 0]),
         | 
| 43 43 | 
             
                ]
         | 
| 44 | 
            -
                orbital_positions = [ | 
| 44 | 
            +
                orbital_positions = [
         | 
| 45 | 
            +
                    (0.5 * (np.sqrt(3) - 1), 0, 0),
         | 
| 46 | 
            +
                    (0.5 * (np.sqrt(3) + 1), 0, 0),
         | 
| 47 | 
            +
                    (0.5 * (np.sqrt(3) - 1), 0, 0),
         | 
| 48 | 
            +
                ]
         | 
| 45 49 | 
             
                hoppings = {
         | 
| 46 50 | 
             
                    (0, 0): [
         | 
| 47 51 | 
             
                        [0, h.hopping_gr, h.hopping_x_gr_a],
         | 
| @@ -50,13 +54,13 @@ def _tbl_factory(h: BaseHamiltonian[GenericParameters]) -> TBLattice: | |
| 50 54 | 
             
                    ],
         | 
| 51 55 | 
             
                    (1, 0): [[0, 0, 0], [h.hopping_gr, 0, 0], [0, 0, 0]],
         | 
| 52 56 | 
             
                    (-1, 0): [[0, h.hopping_gr, 0], [0, 0, 0], [0, 0, 0]],
         | 
| 53 | 
            -
                    (0, 1): [[0,  | 
| 54 | 
            -
                    (0, -1): [[0,  | 
| 57 | 
            +
                    (0, 1): [[0, h.hopping_gr, 0], [0, 0, 0], [0, 0, 0]],
         | 
| 58 | 
            +
                    (0, -1): [[0, 0, 0], [h.hopping_gr, 0, 0], [0, 0, 0]],
         | 
| 55 59 | 
             
                }
         | 
| 56 60 |  | 
| 57 61 | 
             
                return TBLattice(
         | 
| 58 62 | 
             
                    units=basis_vectors,
         | 
| 59 63 | 
             
                    hoppings=hoppings,
         | 
| 60 64 | 
             
                    orbital_positions=orbital_positions,
         | 
| 61 | 
            -
                    orbital_names=[" | 
| 65 | 
            +
                    orbital_names=["A", "B", "X"],
         | 
| 62 66 | 
             
                )
         | 
    
        quant_met/cli/dmft.py
    CHANGED
    
    | @@ -8,7 +8,8 @@ import logging | |
| 8 8 | 
             
            from pathlib import Path
         | 
| 9 9 |  | 
| 10 10 | 
             
            from h5 import HDFArchive
         | 
| 11 | 
            -
            from  | 
| 11 | 
            +
            from mpi4py import MPI
         | 
| 12 | 
            +
            from triqs.gf import Gf
         | 
| 12 13 |  | 
| 13 14 | 
             
            from quant_met.cli._utils import _hamiltonian_factory, _tbl_factory
         | 
| 14 15 | 
             
            from quant_met.dmft.dmft_loop import dmft_loop
         | 
| @@ -43,7 +44,13 @@ def dmft_scf(parameters: Parameters) -> None: | |
| 43 44 | 
             
                    h0_nambu_k[k][:n_orbitals, :n_orbitals] = enk(k)
         | 
| 44 45 | 
             
                    h0_nambu_k[k][n_orbitals:, n_orbitals:] = -enk(-k)
         | 
| 45 46 |  | 
| 46 | 
            -
                 | 
| 47 | 
            +
                ust = 0
         | 
| 48 | 
            +
                jh = 0
         | 
| 49 | 
            +
                xmu = (
         | 
| 50 | 
            +
                    h.hubbard_int_orbital_basis[0] / 2
         | 
| 51 | 
            +
                    + (tbl.n_orbitals - 1) * ust / 2
         | 
| 52 | 
            +
                    + (tbl.n_orbitals - 1) * (ust - jh) / 2
         | 
| 53 | 
            +
                )
         | 
| 47 54 |  | 
| 48 55 | 
             
                solver = dmft_loop(
         | 
| 49 56 | 
             
                    tbl=tbl,
         | 
| @@ -69,23 +76,21 @@ def dmft_scf(parameters: Parameters) -> None: | |
| 69 76 | 
             
                g_iw, g_an_iw = get_gloc(s_iw, s_an_iw, h0_nambu_k, xmu, parameters.control.broadening, kmesh)
         | 
| 70 77 | 
             
                g_w, g_an_w = get_gloc(s_w, s_an_w, h0_nambu_k, xmu, parameters.control.broadening, kmesh)
         | 
| 71 78 |  | 
| 72 | 
            -
                 | 
| 73 | 
            -
                 | 
| 74 | 
            -
             | 
| 75 | 
            -
                gap = s_an_iw[Idx(0)][0, 0].real / (1 - (s_iw[Idx(0)][0, 0].imag / iw_0))
         | 
| 79 | 
            +
                comm = MPI.COMM_WORLD
         | 
| 80 | 
            +
                rank = comm.Get_rank()
         | 
| 76 81 |  | 
| 77 | 
            -
                 | 
| 78 | 
            -
             | 
| 82 | 
            +
                if rank == 0:
         | 
| 83 | 
            +
                    data_dir = Path("data/DressedGraphene/dmft/sweep_V/")
         | 
| 84 | 
            +
                    data_dir.mkdir(parents=True, exist_ok=True)
         | 
| 79 85 |  | 
| 80 | 
            -
             | 
| 81 | 
            -
             | 
| 82 | 
            -
             | 
| 83 | 
            -
             | 
| 84 | 
            -
             | 
| 85 | 
            -
             | 
| 86 | 
            -
             | 
| 87 | 
            -
             | 
| 88 | 
            -
             | 
| 89 | 
            -
                    ar["gap"] = gap
         | 
| 86 | 
            +
                    # Save calculation results
         | 
| 87 | 
            +
                    result_file = result_path / f"{parameters.control.prefix}.hdf5"
         | 
| 88 | 
            +
                    with HDFArchive(f"{result_file}", "w") as ar:
         | 
| 89 | 
            +
                        ar["s_iw"] = s_iw
         | 
| 90 | 
            +
                        ar["s_an_iw"] = s_an_iw
         | 
| 91 | 
            +
                        ar["g_iw"] = g_iw
         | 
| 92 | 
            +
                        ar["g_an_iw"] = g_an_iw
         | 
| 93 | 
            +
                        ar["g_w"] = g_w
         | 
| 94 | 
            +
                        ar["g_an_w"] = g_an_w
         | 
| 90 95 |  | 
| 91 | 
            -
             | 
| 96 | 
            +
                    logger.info("Results saved to %s", result_file)
         | 
    
        quant_met/dmft/dmft_loop.py
    CHANGED
    
    | @@ -18,7 +18,7 @@ from triqs.operators import c, c_dag, dagger, n | |
| 18 18 | 
             
            from quant_met.mean_field.hamiltonians import BaseHamiltonian
         | 
| 19 19 | 
             
            from quant_met.parameters import GenericParameters
         | 
| 20 20 |  | 
| 21 | 
            -
            from .utils import _dmft_weiss_field, get_gloc
         | 
| 21 | 
            +
            from .utils import _check_convergence, _dmft_weiss_field, get_gloc
         | 
| 22 22 |  | 
| 23 23 | 
             
            logger = logging.getLogger(__name__)
         | 
| 24 24 |  | 
| @@ -80,8 +80,27 @@ def dmft_loop( | |
| 80 80 | 
             
                    h_loc[o1, o2] * c_dag(spin, o1) * c(spin, o2) for spin, o1, o2 in product(spins, orbs, orbs)
         | 
| 81 81 | 
             
                )
         | 
| 82 82 |  | 
| 83 | 
            +
                ust = 0
         | 
| 84 | 
            +
                jh = 0
         | 
| 85 | 
            +
                jx = 0
         | 
| 86 | 
            +
                jp = 0
         | 
| 87 | 
            +
             | 
| 83 88 | 
             
                # Interaction part
         | 
| 84 | 
            -
                hamiltonian +=  | 
| 89 | 
            +
                hamiltonian += h.hubbard_int_orbital_basis[0] * sum(n("up", o) * n("dn", o) for o in orbs)
         | 
| 90 | 
            +
                hamiltonian += ust * sum(
         | 
| 91 | 
            +
                    int(o1 != o2) * n("up", o1) * n("dn", o2) for o1, o2 in product(orbs, orbs)
         | 
| 92 | 
            +
                )
         | 
| 93 | 
            +
                hamiltonian += (ust - jh) * sum(
         | 
| 94 | 
            +
                    int(o1 < o2) * n(s, o1) * n(s, o2) for s, o1, o2 in product(spins, orbs, orbs)
         | 
| 95 | 
            +
                )
         | 
| 96 | 
            +
                hamiltonian -= jx * sum(
         | 
| 97 | 
            +
                    int(o1 != o2) * c_dag("up", o1) * c("dn", o1) * c_dag("dn", o2) * c("up", o2)
         | 
| 98 | 
            +
                    for o1, o2 in product(orbs, orbs)
         | 
| 99 | 
            +
                )
         | 
| 100 | 
            +
                hamiltonian += jp * sum(
         | 
| 101 | 
            +
                    int(o1 != o2) * c_dag("up", o1) * c_dag("dn", o1) * c("dn", o2) * c("up", o2)
         | 
| 102 | 
            +
                    for o1, o2 in product(orbs, orbs)
         | 
| 103 | 
            +
                )
         | 
| 85 104 |  | 
| 86 105 | 
             
                # Matrix dimensions of eps and V: 3 orbitals x 2 bath states
         | 
| 87 106 | 
             
                eps = np.array([[-1.0, -0.5, 0.5, 1.0] for _ in range(tbl.n_orbitals)])
         | 
| @@ -119,8 +138,6 @@ def dmft_loop( | |
| 119 138 | 
             
                    bath_fitting_params=fit_params,
         | 
| 120 139 | 
             
                )
         | 
| 121 140 |  | 
| 122 | 
            -
                gooditer = 0
         | 
| 123 | 
            -
                g0_prev = np.zeros((2, 2 * n_iw, tbl.n_orbitals, tbl.n_orbitals), dtype=complex)
         | 
| 124 141 | 
             
                for iloop in range(max_iter):
         | 
| 125 142 | 
             
                    print(f"\nLoop {iloop + 1} of {max_iter}")
         | 
| 126 143 |  | 
| @@ -151,39 +168,11 @@ def dmft_loop( | |
| 151 168 |  | 
| 152 169 | 
             
                    # Check convergence of the Weiss field
         | 
| 153 170 | 
             
                    g0 = np.asarray([g0_iw.data, g0_an_iw.data])
         | 
| 154 | 
            -
                     | 
| 155 | 
            -
                     | 
| 156 | 
            -
                     | 
| 157 | 
            -
                        errvec = np.ones_like(errvec)
         | 
| 158 | 
            -
                    errmin, err, errmax = np.min(errvec), np.average(errvec), np.max(errvec)
         | 
| 159 | 
            -
             | 
| 160 | 
            -
                    g0_prev = np.copy(g0)
         | 
| 161 | 
            -
             | 
| 162 | 
            -
                    if err < epsilon:
         | 
| 163 | 
            -
                        gooditer += 1  # Increase good iterations count
         | 
| 164 | 
            -
                    else:
         | 
| 165 | 
            -
                        gooditer = 0  # Reset good iterations count
         | 
| 166 | 
            -
             | 
| 167 | 
            -
                    conv_bool = ((err < epsilon) and (gooditer > n_success) and (iloop < max_iter)) or (
         | 
| 168 | 
            -
                        iloop >= max_iter
         | 
| 169 | 
            -
                    )
         | 
| 171 | 
            +
                    # Check convergence of the Weiss field
         | 
| 172 | 
            +
                    g0 = np.asarray([g0_iw.data, g0_an_iw.data])
         | 
| 173 | 
            +
                    err, converged = _check_convergence(g0, epsilon, n_success, max_iter)
         | 
| 170 174 |  | 
| 171 | 
            -
                     | 
| 172 | 
            -
                    if iloop < max_iter:
         | 
| 173 | 
            -
                        if errvec.size > 1:
         | 
| 174 | 
            -
                            print(f"max error={errmax:.6e}")
         | 
| 175 | 
            -
                        print("    " * (errvec.size > 1) + f"error={err:.6e}")
         | 
| 176 | 
            -
                        if errvec.size > 1:
         | 
| 177 | 
            -
                            print(f"min error={errmin:.6e}")
         | 
| 178 | 
            -
                    else:
         | 
| 179 | 
            -
                        if errvec.size > 1:
         | 
| 180 | 
            -
                            print(f"max error={errmax:.6e}")
         | 
| 181 | 
            -
                        print("    " * (errvec.size > 1) + f"error={err:.6e}")
         | 
| 182 | 
            -
                        if errvec.size > 1:
         | 
| 183 | 
            -
                            print(f"min error={errmin:.6e}")
         | 
| 184 | 
            -
                        print(f"Not converged after {max_iter} iterations.")
         | 
| 185 | 
            -
             | 
| 186 | 
            -
                    if conv_bool:
         | 
| 175 | 
            +
                    if converged:
         | 
| 187 176 | 
             
                        break
         | 
| 188 177 |  | 
| 189 178 | 
             
                return solver
         | 
    
        quant_met/dmft/utils.py
    CHANGED
    
    | @@ -4,11 +4,120 @@ | |
| 4 4 |  | 
| 5 5 | 
             
            """Utility functions used in DMFT."""
         | 
| 6 6 |  | 
| 7 | 
            +
            import sys
         | 
| 8 | 
            +
            from pathlib import Path
         | 
| 9 | 
            +
             | 
| 7 10 | 
             
            import numpy as np
         | 
| 8 11 | 
             
            import numpy.typing as npt
         | 
| 12 | 
            +
            from mpi4py import MPI
         | 
| 9 13 | 
             
            from triqs.gf import Gf, MeshBrZone, MeshImFreq, MeshProduct, conjugate, dyson, inverse, iOmega_n
         | 
| 10 14 |  | 
| 11 15 |  | 
| 16 | 
            +
            def _check_convergence(
         | 
| 17 | 
            +
                func: npt.NDArray[np.complex128], threshold: float = 1e-6, nsuccess: int = 1, nloop: int = 100
         | 
| 18 | 
            +
            ) -> tuple[float, bool]:
         | 
| 19 | 
            +
                comm = MPI.COMM_WORLD
         | 
| 20 | 
            +
                rank = comm.Get_rank()
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                func = np.asarray(func)
         | 
| 23 | 
            +
                err = 1.0
         | 
| 24 | 
            +
                conv_bool = False
         | 
| 25 | 
            +
                outfile = "error.err"
         | 
| 26 | 
            +
             | 
| 27 | 
            +
                if globals().get("_whichiter") is None:
         | 
| 28 | 
            +
                    global _whichiter
         | 
| 29 | 
            +
                    global _gooditer
         | 
| 30 | 
            +
                    global _oldfunc
         | 
| 31 | 
            +
             | 
| 32 | 
            +
                    _whichiter = 0
         | 
| 33 | 
            +
                    _gooditer = 0
         | 
| 34 | 
            +
                    _oldfunc = np.zeros_like(func)
         | 
| 35 | 
            +
             | 
| 36 | 
            +
                green = "\033[92m"
         | 
| 37 | 
            +
                yellow = "\033[93m"
         | 
| 38 | 
            +
                red = "\033[91m"
         | 
| 39 | 
            +
                bold = "\033[1m"
         | 
| 40 | 
            +
                colorend = "\033[0m"
         | 
| 41 | 
            +
             | 
| 42 | 
            +
                # only the master does the calculation
         | 
| 43 | 
            +
                if rank == 0:
         | 
| 44 | 
            +
                    errvec = np.real(np.sum(abs(func - _oldfunc), axis=-1) / np.sum(abs(func), axis=-1))
         | 
| 45 | 
            +
                    # first iteration
         | 
| 46 | 
            +
                    if _whichiter == 0:
         | 
| 47 | 
            +
                        errvec = np.ones_like(errvec)
         | 
| 48 | 
            +
                        # remove nan compoments, if some component is divided by zero
         | 
| 49 | 
            +
                    if np.prod(np.shape(errvec)) > 1:
         | 
| 50 | 
            +
                        errvec = errvec[~np.isnan(errvec)]
         | 
| 51 | 
            +
                    errmax = np.max(errvec)
         | 
| 52 | 
            +
                    errmin = np.min(errvec)
         | 
| 53 | 
            +
                    err = np.average(errvec)
         | 
| 54 | 
            +
                    _oldfunc = np.copy(func)
         | 
| 55 | 
            +
                    if err < threshold:
         | 
| 56 | 
            +
                        _gooditer += 1  # increase good iterations count
         | 
| 57 | 
            +
                    else:
         | 
| 58 | 
            +
                        _gooditer = 0  # reset good iterations count
         | 
| 59 | 
            +
                    _whichiter += 1
         | 
| 60 | 
            +
                    conv_bool = ((err < threshold) and (_gooditer > nsuccess) and (_whichiter < nloop)) or (
         | 
| 61 | 
            +
                        _whichiter >= nloop
         | 
| 62 | 
            +
                    )
         | 
| 63 | 
            +
             | 
| 64 | 
            +
                    # write out
         | 
| 65 | 
            +
                    with Path(outfile).open("a") as file:
         | 
| 66 | 
            +
                        file.write(f"{_whichiter} {err:.6e}\n")
         | 
| 67 | 
            +
                    if np.prod(np.shape(errvec)) > 1:
         | 
| 68 | 
            +
                        with Path(outfile + ".max").open("a") as file:
         | 
| 69 | 
            +
                            file.write(f"{_whichiter} {errmax:.6e}\n")
         | 
| 70 | 
            +
                        with Path(outfile + ".min").open("a") as file:
         | 
| 71 | 
            +
                            file.write(f"{_whichiter} {errmin:.6e}\n")
         | 
| 72 | 
            +
                        with Path(outfile + ".distribution").open("a") as file:
         | 
| 73 | 
            +
                            file.write(
         | 
| 74 | 
            +
                                f"{_whichiter}" + " ".join([f"{x:.6e}" for x in errvec.flatten()]) + "\n"
         | 
| 75 | 
            +
                            )
         | 
| 76 | 
            +
             | 
| 77 | 
            +
                    # print convergence message:
         | 
| 78 | 
            +
                    if conv_bool:
         | 
| 79 | 
            +
                        colorprefix = bold + green
         | 
| 80 | 
            +
                    elif (err < threshold) and (_gooditer <= nsuccess):
         | 
| 81 | 
            +
                        colorprefix = bold + yellow
         | 
| 82 | 
            +
                    else:
         | 
| 83 | 
            +
                        colorprefix = bold + red
         | 
| 84 | 
            +
             | 
| 85 | 
            +
                    if _whichiter < nloop:
         | 
| 86 | 
            +
                        if np.prod(np.shape(errvec)) > 1:
         | 
| 87 | 
            +
                            print(colorprefix + "max error=" + colorend + f"{errmax:.6e}")
         | 
| 88 | 
            +
                        print(
         | 
| 89 | 
            +
                            colorprefix
         | 
| 90 | 
            +
                            + "    " * (np.prod(np.shape(errvec)) > 1)
         | 
| 91 | 
            +
                            + "error="
         | 
| 92 | 
            +
                            + colorend
         | 
| 93 | 
            +
                            + f"{err:.6e}"
         | 
| 94 | 
            +
                        )
         | 
| 95 | 
            +
                        if np.prod(np.shape(errvec)) > 1:
         | 
| 96 | 
            +
                            print(colorprefix + "min error=" + colorend + f"{errmin:.6e}")
         | 
| 97 | 
            +
                    else:
         | 
| 98 | 
            +
                        if np.prod(np.shape(errvec)) > 1:
         | 
| 99 | 
            +
                            print(colorprefix + "max error=" + colorend + f"{errmax:.6e}")
         | 
| 100 | 
            +
                        print(
         | 
| 101 | 
            +
                            colorprefix
         | 
| 102 | 
            +
                            + "    " * (np.prod(np.shape(errvec)) > 1)
         | 
| 103 | 
            +
                            + "error="
         | 
| 104 | 
            +
                            + colorend
         | 
| 105 | 
            +
                            + f"{err:.6e}"
         | 
| 106 | 
            +
                        )
         | 
| 107 | 
            +
                        if np.prod(np.shape(errvec)) > 1:
         | 
| 108 | 
            +
                            print(colorprefix + "min error=" + colorend + f"{errmin:.6e}")
         | 
| 109 | 
            +
                        print("Not converged after " + str(nloop) + " iterations.")
         | 
| 110 | 
            +
                        with Path("ERROR.README").open("a") as file:
         | 
| 111 | 
            +
                            file.write("Not converged after " + str(nloop) + " iterations.")
         | 
| 112 | 
            +
                    print("\n")
         | 
| 113 | 
            +
             | 
| 114 | 
            +
                # pass to other cores:
         | 
| 115 | 
            +
                conv_bool = comm.bcast(conv_bool, root=0)
         | 
| 116 | 
            +
                err = comm.bcast(err, root=0)
         | 
| 117 | 
            +
                sys.stdout.flush()
         | 
| 118 | 
            +
                return err, conv_bool
         | 
| 119 | 
            +
             | 
| 120 | 
            +
             | 
| 12 121 | 
             
            def get_gloc(
         | 
| 13 122 | 
             
                s: Gf,
         | 
| 14 123 | 
             
                s_an: Gf,
         | 
| @@ -359,7 +359,7 @@ class BaseHamiltonian(Generic[GenericParameters], ABC): | |
| 359 359 | 
             
                def gap_equation_loop(
         | 
| 360 360 | 
             
                    bdg_energies: npt.NDArray[np.float64],
         | 
| 361 361 | 
             
                    bdg_wavefunctions: npt.NDArray[np.complex128],
         | 
| 362 | 
            -
                    delta: npt.NDArray[np. | 
| 362 | 
            +
                    delta: npt.NDArray[np.complex128],
         | 
| 363 363 | 
             
                    beta: float,
         | 
| 364 364 | 
             
                    hubbard_int_orbital_basis: npt.NDArray[np.float64],
         | 
| 365 365 | 
             
                    k: npt.NDArray[np.floating],
         | 
| @@ -48,9 +48,13 @@ class DressedGraphene(BaseHamiltonian[DressedGrapheneParameters]): | |
| 48 48 |  | 
| 49 49 | 
             
                    h = np.zeros((k.shape[0], self.number_of_bands, self.number_of_bands), dtype=np.complex128)
         | 
| 50 50 |  | 
| 51 | 
            -
                    h[:, 0, 1] =  | 
| 52 | 
            -
                         | 
| 53 | 
            -
                         | 
| 51 | 
            +
                    h[:, 0, 1] = (
         | 
| 52 | 
            +
                        -t_gr
         | 
| 53 | 
            +
                        * np.exp(2j * k[:, 1] * a)
         | 
| 54 | 
            +
                        * (
         | 
| 55 | 
            +
                            np.exp(1j * k[:, 1] * a / np.sqrt(3))
         | 
| 56 | 
            +
                            + 2 * np.exp(-0.5j * a / np.sqrt(3) * k[:, 1]) * (np.cos(0.5 * a * k[:, 0]))
         | 
| 57 | 
            +
                        )
         | 
| 54 58 | 
             
                    )
         | 
| 55 59 |  | 
| 56 60 | 
             
                    h[:, 1, 0] = h[:, 0, 1].conjugate()
         | 
| @@ -40,27 +40,28 @@ def _get_bounds( | |
| 40 40 | 
             
                while (found_zero_gap and found_nonzero_gap) is False and iterations < 100:
         | 
| 41 41 | 
             
                    logger.info("Trying temperature: %s", temp)
         | 
| 42 42 | 
             
                    data_dict = gap_for_temp_partial(temp)
         | 
| 43 | 
            +
                    logger.info("Result: %s", data_dict)
         | 
| 43 44 | 
             
                    if data_dict is not None:
         | 
| 44 45 | 
             
                        delta_vs_temp_list.append(data_dict)
         | 
| 45 46 | 
             
                        gap = np.array([data_dict[key] for key in data_dict if key.startswith("delta")])
         | 
| 46 | 
            -
                        if np.allclose(gap, 0):
         | 
| 47 | 
            +
                        if np.allclose(gap, 0, rtol=0, atol=0.10 * np.max(np.abs(zero_temperature_gap))):
         | 
| 47 48 | 
             
                            logger.info("Found temperature with zero gap.")
         | 
| 48 49 | 
             
                            zero_gap_temp = temp
         | 
| 49 50 | 
             
                            found_zero_gap = True
         | 
| 50 51 | 
             
                            temp = 0.5 * temp
         | 
| 51 | 
            -
                        elif np.allclose( | 
| 52 | 
            +
                        elif np.allclose(
         | 
| 53 | 
            +
                            gap, zero_temperature_gap, atol=0.10 * np.max(np.abs(zero_temperature_gap))
         | 
| 54 | 
            +
                        ):
         | 
| 52 55 | 
             
                            logger.info("Found temperature with nonzero gap.")
         | 
| 53 56 | 
             
                            nonzero_gap_temp = temp
         | 
| 54 57 | 
             
                            found_nonzero_gap = True
         | 
| 55 58 | 
             
                            temp = 2 * temp
         | 
| 56 59 | 
             
                        elif direction == "down":
         | 
| 57 | 
            -
                            logger.info(
         | 
| 58 | 
            -
                                "Gap is neither zero nor equal to the nonzero gap. Reducing temperature."
         | 
| 59 | 
            -
                            )
         | 
| 60 | 
            +
                            logger.info("Gap is neither zero nor equal to the zero gap. Reducing temperature.")
         | 
| 60 61 | 
             
                            temp = 0.5 * temp
         | 
| 61 62 | 
             
                        else:
         | 
| 62 63 | 
             
                            logger.info(
         | 
| 63 | 
            -
                                "Gap is neither zero nor equal to the  | 
| 64 | 
            +
                                "Gap is neither zero nor equal to the zero gap. Increasing temperature."
         | 
| 64 65 | 
             
                            )
         | 
| 65 66 | 
             
                            temp = 2 * temp
         | 
| 66 67 | 
             
                    elif direction == "down":
         | 
| @@ -164,7 +165,7 @@ def search_crit_temp( | |
| 164 165 | 
             
            ) -> tuple[pd.DataFrame, list[float], matplotlib.figure.Figure]:  # pragma: no cover
         | 
| 165 166 | 
             
                """Search for critical temperature."""
         | 
| 166 167 | 
             
                logger.info("Start search for bounds for T_C")
         | 
| 167 | 
            -
                temp = 1 / h.beta if not np.isinf(h.beta) else  | 
| 168 | 
            +
                temp = 1 / h.beta if not np.isinf(h.beta) else 10 * h.hubbard_int_orbital_basis[0]
         | 
| 168 169 |  | 
| 169 170 | 
             
                delta_vs_temp_list = []
         | 
| 170 171 | 
             
                critical_temp_list = []
         | 
| @@ -176,6 +177,7 @@ def search_crit_temp( | |
| 176 177 | 
             
                logger.info("Calculating zero temperature gap")
         | 
| 177 178 | 
             
                data_dict = gap_for_temp_partial(0)
         | 
| 178 179 | 
             
                assert data_dict is not None
         | 
| 180 | 
            +
                logger.info("Result: %s", data_dict)
         | 
| 179 181 |  | 
| 180 182 | 
             
                zero_temperature_gap = np.array(
         | 
| 181 183 | 
             
                    [data_dict[key] for key in data_dict if key.startswith("delta")]
         | 
| @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            quant_met/__init__.py,sha256=ZO1UFz1awUYTI7B9ZkBwucvDz7GMGXnLLUGnEwLBhkc,155
         | 
| 2 2 | 
             
            quant_met/utils.py,sha256=J3kCbKg0tPEoGJExX04QwifHn4ch482J8IcmRQxIfP4,2067
         | 
| 3 3 | 
             
            quant_met/cli/__init__.py,sha256=nGFXhK8zWyEKQtsQTyJWfEOLFOHTCjZnfEcrVb2dARc,254
         | 
| 4 | 
            -
            quant_met/cli/_utils.py,sha256= | 
| 4 | 
            +
            quant_met/cli/_utils.py,sha256=MKHvkxudWH-px07lDz0_V1AWiCCvj_IsBYbocfL-r7Y,2036
         | 
| 5 5 | 
             
            quant_met/cli/crit_temp.py,sha256=t9sPZKORl6dpa1UNAOMH2gDmeQxf80iFH7p_L3FI5q8,2027
         | 
| 6 | 
            -
            quant_met/cli/dmft.py,sha256= | 
| 6 | 
            +
            quant_met/cli/dmft.py,sha256=ct6e1Wd8o7V3VP7DB7pqPxyF5pbrR2mb-J8pUkP9UPE,3101
         | 
| 7 7 | 
             
            quant_met/cli/main.py,sha256=1D1-KhGkzibts9b7Cv3JsR5Q-PnkowBWKE1Owc8tdD8,2010
         | 
| 8 8 | 
             
            quant_met/cli/scf.py,sha256=3_rwtQHwypFjAwjrsO2r2sqjJKpNiDLAj6svU52CCcU,2613
         | 
| 9 9 | 
             
            quant_met/dmft/__init__.py,sha256=2H0bN40Tvn-VnZgix6MugN0Q6iNwD_9AQxUC_LVLh70,99
         | 
| 10 | 
            -
            quant_met/dmft/dmft_loop.py,sha256= | 
| 11 | 
            -
            quant_met/dmft/utils.py,sha256= | 
| 10 | 
            +
            quant_met/dmft/dmft_loop.py,sha256=fH8v39I5yIY2iY5RaID43El1V0nxLewAfohNsq987_A,5272
         | 
| 11 | 
            +
            quant_met/dmft/utils.py,sha256=JO66kuTXruYCwNoVL0aFS55D3tV7Ii3v7hC9OpuWfF8,6636
         | 
| 12 12 | 
             
            quant_met/geometry/__init__.py,sha256=2N8l0-2-PhEOQxaUO7e8Dqy5oaxt2y9343XENDTCGPE,592
         | 
| 13 13 | 
             
            quant_met/geometry/base_lattice.py,sha256=OJNDMyzJB-0hK1BLgF-SV4jUYfOSUksIv1XG1bH-zyY,2649
         | 
| 14 14 | 
             
            quant_met/geometry/bz_path.py,sha256=vwN5RxyrgFkHTSqm_6cWuOigICgxa-FX5NZ7SkgKScw,2503
         | 
| @@ -16,11 +16,11 @@ quant_met/geometry/graphene.py,sha256=ZLE55wV1E-jRCkGxW66pca2y5VWaNtMmXiXi-HB6bg | |
| 16 16 | 
             
            quant_met/geometry/square.py,sha256=17XZH79lK9TeeDtXiBBa8rd2d9kv5yt2S9F6te0YZPU,1565
         | 
| 17 17 | 
             
            quant_met/mean_field/__init__.py,sha256=Unweog9Tst1NxUMQ4X1OYiUQtyxI2ho-OQoCaekoMFk,597
         | 
| 18 18 | 
             
            quant_met/mean_field/_utils.py,sha256=7hr0DDSdIqjft5Jjluvbw_HGoNLWgYJTxyuPJJvhBnc,356
         | 
| 19 | 
            -
            quant_met/mean_field/search_crit_temp.py,sha256 | 
| 19 | 
            +
            quant_met/mean_field/search_crit_temp.py,sha256=-A1ZegUOQXxh_SwmQeqMZCptnSLWuxDJsjdZK9XK-zE,8917
         | 
| 20 20 | 
             
            quant_met/mean_field/self_consistency.py,sha256=YY_zhCurxOK3RLkK-Hglfkx33uhsvqpoAKOP4FuPdfo,3371
         | 
| 21 21 | 
             
            quant_met/mean_field/hamiltonians/__init__.py,sha256=r-8TaLqRnRbAro-TMIyxzCCZHwVqyKrausODpQJb2tw,681
         | 
| 22 | 
            -
            quant_met/mean_field/hamiltonians/base_hamiltonian.py,sha256= | 
| 23 | 
            -
            quant_met/mean_field/hamiltonians/dressed_graphene.py,sha256= | 
| 22 | 
            +
            quant_met/mean_field/hamiltonians/base_hamiltonian.py,sha256=0qRfSpiE5jybv4GmBGmuNKFl1fkE4fzXG15II1IyIu8,29374
         | 
| 23 | 
            +
            quant_met/mean_field/hamiltonians/dressed_graphene.py,sha256=iPQshQqvtWf-NbeSdn8VbtuSU1g7maKUjFPfoji8zwk,4135
         | 
| 24 24 | 
             
            quant_met/mean_field/hamiltonians/graphene.py,sha256=sa3H8jVq9Fkc_qcz5gJTCMgN8YD3N18JWLRBImhLyxo,3276
         | 
| 25 25 | 
             
            quant_met/mean_field/hamiltonians/one_band_tight_binding.py,sha256=DZXaD95yWv1VZSMqgxkqEZv3PGihNGy7PuqupnN75ew,2512
         | 
| 26 26 | 
             
            quant_met/mean_field/hamiltonians/three_band_tight_binding.py,sha256=g8XNImzCn_6CRYKDYI6sy3q6_TBYUDxDmQZ-AqenXTE,3295
         | 
| @@ -30,8 +30,8 @@ quant_met/parameters/hamiltonians.py,sha256=PiWVV-miCdT4Z9GWloDVvIU_1QpRHHV-zVOg | |
| 30 30 | 
             
            quant_met/parameters/main.py,sha256=QP7Z24-QePMcy6txujqxbx5ztQTdC67m6elNsJtGtXQ,2325
         | 
| 31 31 | 
             
            quant_met/plotting/__init__.py,sha256=IDgV6juJ0VfcJHppD-vnPH6w8wVuAC35eSeLxKzqyBc,523
         | 
| 32 32 | 
             
            quant_met/plotting/plotting.py,sha256=4ZYclWJH3hlE8S7b7bL_JJlP3CKaCGcVzdIsqolCAaM,6592
         | 
| 33 | 
            -
            quant_met-0.0. | 
| 34 | 
            -
            quant_met-0.0. | 
| 35 | 
            -
            quant_met-0.0. | 
| 36 | 
            -
            quant_met-0.0. | 
| 37 | 
            -
            quant_met-0.0. | 
| 33 | 
            +
            quant_met-0.0.25.dist-info/METADATA,sha256=YQrLNOTWAkjrK8nXd4DwRi1_NQ6oJSypbzWpyJzlSHE,1978
         | 
| 34 | 
            +
            quant_met-0.0.25.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
         | 
| 35 | 
            +
            quant_met-0.0.25.dist-info/entry_points.txt,sha256=1Al3Kt-cMeQxwMp84ZSNL0qFwlbOVBu1o8A19MH8lEU,48
         | 
| 36 | 
            +
            quant_met-0.0.25.dist-info/licenses/LICENSE.txt,sha256=QO_duPQihSJlaxSLxPAXo52X3esROP5wBkhxqBd1Z4E,1104
         | 
| 37 | 
            +
            quant_met-0.0.25.dist-info/RECORD,,
         | 
| 
            File without changes
         | 
| 
            File without changes
         | 
| 
            File without changes
         |