quant-met 0.0.11__py3-none-any.whl → 0.0.13__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 +31 -0
- quant_met/cli/crit_temp.py +55 -0
- quant_met/cli/main.py +4 -0
- quant_met/cli/scf.py +4 -29
- quant_met/mean_field/__init__.py +3 -0
- quant_met/mean_field/search_crit_temp.py +227 -0
- quant_met/mean_field/self_consistency.py +4 -8
- quant_met/parameters/__init__.py +1 -0
- quant_met/parameters/hamiltonians.py +13 -24
- quant_met/parameters/main.py +16 -4
- {quant_met-0.0.11.dist-info → quant_met-0.0.13.dist-info}/METADATA +3 -2
- {quant_met-0.0.11.dist-info → quant_met-0.0.13.dist-info}/RECORD +16 -13
- {quant_met-0.0.11.dist-info → quant_met-0.0.13.dist-info}/LICENSE.txt +0 -0
- {quant_met-0.0.11.dist-info → quant_met-0.0.13.dist-info}/LICENSES/MIT.txt +0 -0
- {quant_met-0.0.11.dist-info → quant_met-0.0.13.dist-info}/WHEEL +0 -0
- {quant_met-0.0.11.dist-info → quant_met-0.0.13.dist-info}/entry_points.txt +0 -0
quant_met/cli/_utils.py
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# SPDX-FileCopyrightText: 2024 Tjark Sievers
|
2
|
+
#
|
3
|
+
# SPDX-License-Identifier: MIT
|
4
|
+
|
5
|
+
from quant_met.mean_field.hamiltonians import BaseHamiltonian
|
6
|
+
from quant_met.parameters import HamiltonianParameters
|
7
|
+
|
8
|
+
|
9
|
+
def _hamiltonian_factory(
|
10
|
+
classname: str, parameters: HamiltonianParameters
|
11
|
+
) -> BaseHamiltonian[HamiltonianParameters]:
|
12
|
+
"""Create a Hamiltonian by its class name.
|
13
|
+
|
14
|
+
Parameters
|
15
|
+
----------
|
16
|
+
classname: str
|
17
|
+
The name of the Hamiltonian class to instantiate.
|
18
|
+
parameters: HamiltonianParameters
|
19
|
+
An instance of HamiltonianParameters containing all necessary
|
20
|
+
configuration for the specific Hamiltonian.
|
21
|
+
|
22
|
+
Returns
|
23
|
+
-------
|
24
|
+
BaseHamiltonian[HamiltonianParameters]
|
25
|
+
An instance of the specified Hamiltonian class.
|
26
|
+
"""
|
27
|
+
from quant_met.mean_field import hamiltonians
|
28
|
+
|
29
|
+
cls = getattr(hamiltonians, classname)
|
30
|
+
h: BaseHamiltonian[HamiltonianParameters] = cls(parameters)
|
31
|
+
return h
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# SPDX-FileCopyrightText: 2024 Tjark Sievers
|
2
|
+
#
|
3
|
+
# SPDX-License-Identifier: MIT
|
4
|
+
|
5
|
+
"""Functions to run self-consistent calculation for the order parameter."""
|
6
|
+
|
7
|
+
import logging
|
8
|
+
from pathlib import Path
|
9
|
+
|
10
|
+
import h5py
|
11
|
+
|
12
|
+
from quant_met import mean_field
|
13
|
+
from quant_met.parameters import Parameters
|
14
|
+
|
15
|
+
from ._utils import _hamiltonian_factory
|
16
|
+
|
17
|
+
logger = logging.getLogger(__name__)
|
18
|
+
|
19
|
+
|
20
|
+
def crit_temp(parameters: Parameters) -> None:
|
21
|
+
"""Self-consistent calculation for the order parameter.
|
22
|
+
|
23
|
+
Parameters
|
24
|
+
----------
|
25
|
+
parameters: Parameters
|
26
|
+
An instance of Parameters containing control settings, the model,
|
27
|
+
and k-point specifications for the T_C calculation.
|
28
|
+
"""
|
29
|
+
result_path = Path(parameters.control.outdir)
|
30
|
+
result_path.mkdir(exist_ok=True, parents=True)
|
31
|
+
|
32
|
+
h = _hamiltonian_factory(parameters=parameters.model, classname=parameters.model.name)
|
33
|
+
|
34
|
+
delta_vs_temp, critical_temperatures, fit_fig = mean_field.search_crit_temp(
|
35
|
+
h=h,
|
36
|
+
k_space_grid=h.lattice.generate_bz_grid(
|
37
|
+
ncols=parameters.k_points.nk1, nrows=parameters.k_points.nk2
|
38
|
+
),
|
39
|
+
epsilon=parameters.control.conv_treshold,
|
40
|
+
max_iter=parameters.control.max_iter,
|
41
|
+
n_temp_points=parameters.control.n_temp_points,
|
42
|
+
)
|
43
|
+
|
44
|
+
logger.info("Search for T_C completed successfully.")
|
45
|
+
logger.info("Obtained T_Cs: %s", critical_temperatures)
|
46
|
+
|
47
|
+
fit_fig.savefig(result_path / f"{parameters.control.prefix}_T_C_fit.pdf", bbox_inches="tight")
|
48
|
+
|
49
|
+
result_file = result_path / f"{parameters.control.prefix}.hdf5"
|
50
|
+
delta_vs_temp.to_hdf(result_file, key="delta_vs_temp")
|
51
|
+
with h5py.File(result_file, mode="a") as file:
|
52
|
+
for orbital, crit_temp_orbital in enumerate(critical_temperatures):
|
53
|
+
file.attrs[f"T_C_{orbital}"] = crit_temp_orbital
|
54
|
+
|
55
|
+
logger.info("Results saved to %s", result_file)
|
quant_met/cli/main.py
CHANGED
@@ -13,6 +13,7 @@ import yaml
|
|
13
13
|
|
14
14
|
from quant_met.parameters import Parameters
|
15
15
|
|
16
|
+
from .crit_temp import crit_temp
|
16
17
|
from .scf import scf
|
17
18
|
|
18
19
|
logger = logging.getLogger(__name__)
|
@@ -56,6 +57,9 @@ def cli(input_file: TextIO, *, debug: bool) -> None:
|
|
56
57
|
case "scf":
|
57
58
|
logger.info("Starting SCF calculation.")
|
58
59
|
scf(params)
|
60
|
+
case "crit-temp":
|
61
|
+
logger.info("Starting T_C calculation.")
|
62
|
+
crit_temp(params)
|
59
63
|
case _:
|
60
64
|
logger.error("Calculation %s not found.", params.control.calculation)
|
61
65
|
sys.exit(1)
|
quant_met/cli/scf.py
CHANGED
@@ -8,35 +8,11 @@ import logging
|
|
8
8
|
from pathlib import Path
|
9
9
|
|
10
10
|
from quant_met import mean_field
|
11
|
-
from quant_met.
|
12
|
-
from quant_met.parameters import HamiltonianParameters, Parameters
|
11
|
+
from quant_met.parameters import Parameters
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
def _hamiltonian_factory(
|
18
|
-
classname: str, parameters: HamiltonianParameters
|
19
|
-
) -> BaseHamiltonian[HamiltonianParameters]:
|
20
|
-
"""Create a Hamiltonian by its class name.
|
13
|
+
from ._utils import _hamiltonian_factory
|
21
14
|
|
22
|
-
|
23
|
-
----------
|
24
|
-
classname: str
|
25
|
-
The name of the Hamiltonian class to instantiate.
|
26
|
-
parameters: HamiltonianParameters
|
27
|
-
An instance of HamiltonianParameters containing all necessary
|
28
|
-
configuration for the specific Hamiltonian.
|
29
|
-
|
30
|
-
Returns
|
31
|
-
-------
|
32
|
-
BaseHamiltonian[HamiltonianParameters]
|
33
|
-
An instance of the specified Hamiltonian class.
|
34
|
-
"""
|
35
|
-
from quant_met.mean_field import hamiltonians
|
36
|
-
|
37
|
-
cls = getattr(hamiltonians, classname)
|
38
|
-
h: BaseHamiltonian[HamiltonianParameters] = cls(parameters)
|
39
|
-
return h
|
15
|
+
logger = logging.getLogger(__name__)
|
40
16
|
|
41
17
|
|
42
18
|
def scf(parameters: Parameters) -> None:
|
@@ -51,16 +27,15 @@ def scf(parameters: Parameters) -> None:
|
|
51
27
|
result_path = Path(parameters.control.outdir)
|
52
28
|
result_path.mkdir(exist_ok=True, parents=True)
|
53
29
|
|
54
|
-
logger.info("Initializing Hamiltonian factory.")
|
55
30
|
h = _hamiltonian_factory(parameters=parameters.model, classname=parameters.model.name)
|
56
31
|
|
57
|
-
logger.info("Starting self-consistency loop.")
|
58
32
|
solved_h = mean_field.self_consistency_loop(
|
59
33
|
h=h,
|
60
34
|
k_space_grid=h.lattice.generate_bz_grid(
|
61
35
|
ncols=parameters.k_points.nk1, nrows=parameters.k_points.nk2
|
62
36
|
),
|
63
37
|
epsilon=parameters.control.conv_treshold,
|
38
|
+
max_iter=parameters.control.max_iter,
|
64
39
|
)
|
65
40
|
|
66
41
|
logger.info("Self-consistency loop completed successfully.")
|
quant_met/mean_field/__init__.py
CHANGED
@@ -24,11 +24,13 @@ Functions
|
|
24
24
|
superfluid_weight
|
25
25
|
quantum_metric
|
26
26
|
self_consistency_loop
|
27
|
+
search_crit_temp
|
27
28
|
""" # noqa: D205, D400
|
28
29
|
|
29
30
|
from quant_met.mean_field import hamiltonians
|
30
31
|
|
31
32
|
from .quantum_metric import quantum_metric
|
33
|
+
from .search_crit_temp import search_crit_temp
|
32
34
|
from .self_consistency import self_consistency_loop
|
33
35
|
from .superfluid_weight import superfluid_weight
|
34
36
|
|
@@ -36,5 +38,6 @@ __all__ = [
|
|
36
38
|
"superfluid_weight",
|
37
39
|
"quantum_metric",
|
38
40
|
"self_consistency_loop",
|
41
|
+
"search_crit_temp",
|
39
42
|
"hamiltonians",
|
40
43
|
]
|
@@ -0,0 +1,227 @@
|
|
1
|
+
# SPDX-FileCopyrightText: 2024 Tjark Sievers
|
2
|
+
#
|
3
|
+
# SPDX-License-Identifier: MIT
|
4
|
+
|
5
|
+
"""Function to run search for critical temperature."""
|
6
|
+
|
7
|
+
import logging
|
8
|
+
from functools import partial
|
9
|
+
from multiprocessing import Pool
|
10
|
+
from typing import Any
|
11
|
+
|
12
|
+
import matplotlib.figure
|
13
|
+
import matplotlib.pyplot as plt
|
14
|
+
import numpy as np
|
15
|
+
import numpy.typing as npt
|
16
|
+
import pandas as pd
|
17
|
+
from scipy import stats
|
18
|
+
|
19
|
+
from quant_met import plotting
|
20
|
+
from quant_met.parameters import GenericParameters
|
21
|
+
|
22
|
+
from .hamiltonians import BaseHamiltonian
|
23
|
+
from .self_consistency import self_consistency_loop
|
24
|
+
|
25
|
+
logger = logging.getLogger(__name__)
|
26
|
+
|
27
|
+
|
28
|
+
def _get_bounds(
|
29
|
+
temp: float,
|
30
|
+
gap_for_temp_partial: partial[dict[str, Any] | None],
|
31
|
+
zero_temperature_gap: npt.NDArray[np.complex64],
|
32
|
+
) -> tuple[list[dict[str, Any]], float, float]: # pragma: no cover
|
33
|
+
delta_vs_temp_list = []
|
34
|
+
zero_gap_temp = nonzero_gap_temp = temp
|
35
|
+
found_zero_gap = False
|
36
|
+
found_nonzero_gap = False
|
37
|
+
iterations = 0
|
38
|
+
while (found_zero_gap and found_nonzero_gap) is False and iterations < 100:
|
39
|
+
logger.info("Trying temperature: %s", temp)
|
40
|
+
data_dict = gap_for_temp_partial(temp)
|
41
|
+
if data_dict is not None:
|
42
|
+
delta_vs_temp_list.append(data_dict)
|
43
|
+
gap = np.array([data_dict[key] for key in data_dict if key.startswith("delta")])
|
44
|
+
if np.allclose(gap, 0):
|
45
|
+
zero_gap_temp = temp
|
46
|
+
temp = 0.5 * temp
|
47
|
+
logger.info("Found temperature with zero gap.")
|
48
|
+
found_zero_gap = True
|
49
|
+
elif np.allclose(gap, zero_temperature_gap):
|
50
|
+
nonzero_gap_temp = temp
|
51
|
+
temp = 2 * temp
|
52
|
+
logger.info("Found temperature with nonzero gap.")
|
53
|
+
found_nonzero_gap = True
|
54
|
+
else:
|
55
|
+
temp = 0.5 * temp
|
56
|
+
else:
|
57
|
+
temp = 0.5 * temp
|
58
|
+
iterations += 1
|
59
|
+
return delta_vs_temp_list, zero_gap_temp, nonzero_gap_temp
|
60
|
+
|
61
|
+
|
62
|
+
def _fit_for_crit_temp(
|
63
|
+
delta_vs_temp: pd.DataFrame, orbital: int
|
64
|
+
) -> tuple[pd.DataFrame | None, pd.DataFrame, float | None, float | None]: # pragma: no cover
|
65
|
+
filtered_results = delta_vs_temp.iloc[
|
66
|
+
np.where(
|
67
|
+
np.invert(
|
68
|
+
np.logical_or(
|
69
|
+
np.isclose(
|
70
|
+
np.abs(delta_vs_temp[f"delta_{orbital}"]) ** 2,
|
71
|
+
0,
|
72
|
+
atol=1000 * (np.abs(delta_vs_temp[f"delta_{orbital}"]) ** 2).min(),
|
73
|
+
rtol=1e-3,
|
74
|
+
),
|
75
|
+
np.isclose(
|
76
|
+
np.abs(delta_vs_temp[f"delta_{orbital}"]) ** 2,
|
77
|
+
(np.abs(delta_vs_temp[f"delta_{orbital}"]) ** 2).max(),
|
78
|
+
rtol=1e-3,
|
79
|
+
),
|
80
|
+
)
|
81
|
+
)
|
82
|
+
)
|
83
|
+
]
|
84
|
+
|
85
|
+
err = []
|
86
|
+
if len(filtered_results) <= 4:
|
87
|
+
return None, filtered_results, None, None
|
88
|
+
|
89
|
+
lengths = range(4, len(filtered_results))
|
90
|
+
|
91
|
+
for length in lengths:
|
92
|
+
range_results = filtered_results.iloc[-length:]
|
93
|
+
linreg = stats.linregress(
|
94
|
+
range_results["T"], np.abs(range_results[f"delta_{orbital}"]) ** 2
|
95
|
+
)
|
96
|
+
err.append(linreg.stderr)
|
97
|
+
|
98
|
+
min_length = lengths[np.argmin(np.array(err))]
|
99
|
+
range_results = filtered_results.iloc[-min_length:]
|
100
|
+
linreg = stats.linregress(range_results["T"], np.abs(range_results[f"delta_{orbital}"]) ** 2)
|
101
|
+
|
102
|
+
return range_results, filtered_results, linreg.intercept, linreg.slope
|
103
|
+
|
104
|
+
|
105
|
+
def _gap_for_temp(
|
106
|
+
temp: float,
|
107
|
+
h: BaseHamiltonian[GenericParameters],
|
108
|
+
k_space_grid: npt.NDArray[np.float64],
|
109
|
+
epsilon: float,
|
110
|
+
max_iter: int = 1000,
|
111
|
+
) -> dict[str, Any] | None: # pragma: no cover
|
112
|
+
beta = np.inf if temp == 0 else 1 / temp
|
113
|
+
h.beta = beta
|
114
|
+
try:
|
115
|
+
solved_h = self_consistency_loop(h, k_space_grid, epsilon, max_iter)
|
116
|
+
except RuntimeError:
|
117
|
+
logger.exception("Did not converge.")
|
118
|
+
return None
|
119
|
+
else:
|
120
|
+
data_dict = {
|
121
|
+
"T": temp,
|
122
|
+
}
|
123
|
+
zero_temperature_gap = solved_h.delta_orbital_basis
|
124
|
+
data_dict.update(
|
125
|
+
{
|
126
|
+
f"delta_{orbital}": zero_temperature_gap[orbital]
|
127
|
+
for orbital in range(len(zero_temperature_gap))
|
128
|
+
}
|
129
|
+
)
|
130
|
+
return data_dict
|
131
|
+
|
132
|
+
|
133
|
+
def search_crit_temp(
|
134
|
+
h: BaseHamiltonian[GenericParameters],
|
135
|
+
k_space_grid: npt.NDArray[np.float64],
|
136
|
+
epsilon: float,
|
137
|
+
max_iter: int,
|
138
|
+
n_temp_points: int,
|
139
|
+
) -> tuple[pd.DataFrame, list[float], matplotlib.figure.Figure]: # pragma: no cover
|
140
|
+
"""Search for critical temperature."""
|
141
|
+
logger.info("Start search for bounds for T_C")
|
142
|
+
temp = 1 / h.beta if not np.isinf(h.beta) else 0.25 * h.hubbard_int_orbital_basis[0]
|
143
|
+
|
144
|
+
delta_vs_temp_list = []
|
145
|
+
critical_temp_list = []
|
146
|
+
|
147
|
+
gap_for_temp_partial = partial(
|
148
|
+
_gap_for_temp, h=h, k_space_grid=k_space_grid, epsilon=epsilon, max_iter=max_iter
|
149
|
+
)
|
150
|
+
|
151
|
+
data_dict = gap_for_temp_partial(0)
|
152
|
+
assert data_dict is not None
|
153
|
+
|
154
|
+
logger.info("Calculating zero temperature gap")
|
155
|
+
zero_temperature_gap = np.array(
|
156
|
+
[data_dict[key] for key in data_dict if key.startswith("delta")]
|
157
|
+
)
|
158
|
+
delta_vs_temp_list.append(data_dict)
|
159
|
+
|
160
|
+
delta_vs_temp_list_tmp, zero_gap_temp, nonzero_gap_temp = _get_bounds(
|
161
|
+
temp, gap_for_temp_partial, zero_temperature_gap
|
162
|
+
)
|
163
|
+
delta_vs_temp_list.extend(delta_vs_temp_list_tmp)
|
164
|
+
logger.info("Temperature bounds: %s to %s", nonzero_gap_temp, zero_gap_temp)
|
165
|
+
|
166
|
+
temperature_list = np.concatenate(
|
167
|
+
[
|
168
|
+
np.linspace(
|
169
|
+
0.8 * nonzero_gap_temp,
|
170
|
+
nonzero_gap_temp,
|
171
|
+
num=int(0.05 * n_temp_points),
|
172
|
+
endpoint=False,
|
173
|
+
),
|
174
|
+
np.linspace(
|
175
|
+
nonzero_gap_temp, zero_gap_temp, num=int(0.9 * n_temp_points), endpoint=False
|
176
|
+
),
|
177
|
+
np.linspace(
|
178
|
+
zero_gap_temp, 1.2 * zero_gap_temp, num=int(0.05 * n_temp_points), endpoint=True
|
179
|
+
),
|
180
|
+
]
|
181
|
+
)
|
182
|
+
|
183
|
+
with Pool() as p:
|
184
|
+
delta_vs_temp_list.extend(p.map(gap_for_temp_partial, temperature_list)) # type: ignore[arg-type]
|
185
|
+
delta_vs_temp_list = [x for x in delta_vs_temp_list if x is not None]
|
186
|
+
|
187
|
+
delta_vs_temp = pd.DataFrame(delta_vs_temp_list).sort_values(by=["T"]).reset_index(drop=True)
|
188
|
+
|
189
|
+
fit_fig, fit_axs = plt.subplots(
|
190
|
+
nrows=1, ncols=h.number_of_bands, figsize=(h.number_of_bands * 6, 6)
|
191
|
+
)
|
192
|
+
|
193
|
+
for orbital in range(h.number_of_bands):
|
194
|
+
fit_range, filtered_range, intercept, slope = _fit_for_crit_temp(delta_vs_temp, orbital)
|
195
|
+
|
196
|
+
ax = fit_axs if h.number_of_bands == 1 else fit_axs[orbital]
|
197
|
+
|
198
|
+
if fit_range is not None and intercept is not None and slope is not None:
|
199
|
+
critical_temp = -intercept / slope
|
200
|
+
critical_temp_list.append(critical_temp)
|
201
|
+
|
202
|
+
ax.plot(
|
203
|
+
filtered_range["T"],
|
204
|
+
intercept + slope * filtered_range["T"],
|
205
|
+
"r--",
|
206
|
+
alpha=0.3,
|
207
|
+
)
|
208
|
+
ax.plot(
|
209
|
+
fit_range["T"],
|
210
|
+
intercept + slope * fit_range["T"],
|
211
|
+
"r-",
|
212
|
+
)
|
213
|
+
ax.axvline(x=critical_temp, linestyle="--", color="gray")
|
214
|
+
else:
|
215
|
+
critical_temp = 0
|
216
|
+
critical_temp_list.append(critical_temp)
|
217
|
+
|
218
|
+
ax.plot(
|
219
|
+
delta_vs_temp["T"],
|
220
|
+
np.abs(delta_vs_temp[f"delta_{orbital}"]) ** 2,
|
221
|
+
"--x",
|
222
|
+
color=f"C{orbital}",
|
223
|
+
)
|
224
|
+
ax = plotting.format_plot(ax)
|
225
|
+
ax.set_ylabel(r"$\vert\Delta\vert^2\ [t^2]$")
|
226
|
+
|
227
|
+
return delta_vs_temp, critical_temp_list, fit_fig
|
@@ -5,7 +5,6 @@
|
|
5
5
|
"""Self-consistency loop."""
|
6
6
|
|
7
7
|
import logging
|
8
|
-
import sys
|
9
8
|
|
10
9
|
import numpy as np
|
11
10
|
import numpy.typing as npt
|
@@ -71,19 +70,16 @@ def self_consistency_loop(
|
|
71
70
|
while True:
|
72
71
|
iteration_count += 1
|
73
72
|
if iteration_count > max_iter:
|
74
|
-
|
73
|
+
msg = "Maximum number of iterations reached."
|
74
|
+
raise RuntimeError(msg)
|
75
75
|
|
76
76
|
logger.debug("Iteration %d: Computing new gaps.", iteration_count)
|
77
77
|
|
78
78
|
new_gap = h.gap_equation(k=k_space_grid)
|
79
79
|
|
80
|
-
if not np.allclose(h.delta_orbital_basis, 0):
|
81
|
-
delta_change = np.abs(h.delta_orbital_basis - new_gap) / np.abs(h.delta_orbital_basis)
|
82
|
-
else:
|
83
|
-
delta_change = np.abs(h.delta_orbital_basis - new_gap)
|
84
80
|
logger.debug("New gaps computed: %s", new_gap)
|
85
81
|
|
86
|
-
if (
|
82
|
+
if np.allclose(h.delta_orbital_basis, new_gap, atol=1e-10, rtol=epsilon):
|
87
83
|
h.delta_orbital_basis = new_gap
|
88
84
|
logger.info("Convergence achieved after %d iterations.", iteration_count)
|
89
85
|
return h
|
@@ -91,4 +87,4 @@ def self_consistency_loop(
|
|
91
87
|
mixing_greed = 0.2
|
92
88
|
h.delta_orbital_basis = mixing_greed * new_gap + (1 - mixing_greed) * h.delta_orbital_basis
|
93
89
|
logger.debug("Updated gaps: %s", h.delta_orbital_basis)
|
94
|
-
logger.debug("Change in gaps: %s",
|
90
|
+
logger.debug("Change in gaps: %s", np.abs(h.delta_orbital_basis - new_gap))
|
quant_met/parameters/__init__.py
CHANGED
@@ -3,19 +3,20 @@
|
|
3
3
|
# SPDX-License-Identifier: MIT
|
4
4
|
|
5
5
|
"""
|
6
|
-
|
7
|
-
|
6
|
+
hamiltonians
|
7
|
+
============
|
8
8
|
|
9
9
|
Classes holding the configuration for the Hamiltonians.
|
10
10
|
|
11
11
|
.. autosummary::
|
12
|
-
:toctree:
|
12
|
+
:toctree:
|
13
|
+
:template: autosummary/pydantic.rst
|
13
14
|
|
14
15
|
HamiltonianParameters
|
15
16
|
DressedGrapheneParameters
|
16
17
|
GrapheneParameters
|
17
18
|
OneBandParameters
|
18
|
-
|
19
|
+
TwoBandParameters
|
19
20
|
ThreeBandParameters
|
20
21
|
""" # noqa: D205, D400
|
21
22
|
|
@@ -49,28 +50,16 @@ def validate_float(value: float, info: ValidationInfo) -> float:
|
|
49
50
|
|
50
51
|
|
51
52
|
class HamiltonianParameters(BaseModel):
|
52
|
-
"""Base class for Hamiltonian parameters.
|
53
|
-
|
54
|
-
Attributes
|
55
|
-
----------
|
56
|
-
name : str
|
57
|
-
The name of the Hamiltonian model (e.g., "Graphene", "DressedGraphene").
|
58
|
-
beta : float
|
59
|
-
The inverse temperature; default is set to infinity.
|
60
|
-
q : :class:`numpy.ndarray` | None
|
61
|
-
An optional numpy array representing the momentum of Cooper pairs.
|
62
|
-
hubbard_int_orbital_basis : :class:`numpy.ndarray`
|
63
|
-
A numpy array representing the Hubbard interactions in the orbital basis.
|
64
|
-
"""
|
53
|
+
"""Base class for Hamiltonian parameters."""
|
65
54
|
|
66
55
|
name: str
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
56
|
+
"""The name of the Hamiltonian model (e.g., "Graphene", "DressedGraphene")."""
|
57
|
+
hubbard_int_orbital_basis: NDArray
|
58
|
+
"""A numpy array representing the Hubbard interactions in the orbital basis."""
|
59
|
+
beta: float = np.inf
|
60
|
+
"""The inverse temperature; default is set to infinity."""
|
61
|
+
q: NDArray[Shape["2"], float] | None = None
|
62
|
+
"""An optional numpy array representing the momentum of Cooper pairs."""
|
74
63
|
|
75
64
|
|
76
65
|
class DressedGrapheneParameters(HamiltonianParameters):
|
quant_met/parameters/main.py
CHANGED
@@ -8,7 +8,13 @@ import pathlib
|
|
8
8
|
|
9
9
|
from pydantic import BaseModel, Field
|
10
10
|
|
11
|
-
from .hamiltonians import
|
11
|
+
from .hamiltonians import (
|
12
|
+
DressedGrapheneParameters,
|
13
|
+
GrapheneParameters,
|
14
|
+
OneBandParameters,
|
15
|
+
ThreeBandParameters,
|
16
|
+
TwoBandParameters,
|
17
|
+
)
|
12
18
|
|
13
19
|
|
14
20
|
class Control(BaseModel):
|
@@ -31,6 +37,8 @@ class Control(BaseModel):
|
|
31
37
|
prefix: str
|
32
38
|
outdir: pathlib.Path
|
33
39
|
conv_treshold: float
|
40
|
+
max_iter: int = 1000
|
41
|
+
n_temp_points: int = 50
|
34
42
|
|
35
43
|
|
36
44
|
class KPoints(BaseModel):
|
@@ -63,7 +71,11 @@ class Parameters(BaseModel):
|
|
63
71
|
"""
|
64
72
|
|
65
73
|
control: Control
|
66
|
-
model:
|
67
|
-
|
68
|
-
|
74
|
+
model: (
|
75
|
+
DressedGrapheneParameters
|
76
|
+
| GrapheneParameters
|
77
|
+
| OneBandParameters
|
78
|
+
| TwoBandParameters
|
79
|
+
| ThreeBandParameters
|
80
|
+
) = Field(..., discriminator="name")
|
69
81
|
k_points: KPoints
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: quant-met
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.13
|
4
4
|
Summary: Calculate superconductivity in flat-band systems.
|
5
5
|
Home-page: https://quant-met.tjarksievers.de
|
6
6
|
Author: Tjark Sievers
|
@@ -17,6 +17,7 @@ Requires-Dist: numpydantic (>=1.6.4,<2.0.0)
|
|
17
17
|
Requires-Dist: pandas (>=2.2.3,<3.0.0)
|
18
18
|
Requires-Dist: pydantic (>=2.9.2,<3.0.0)
|
19
19
|
Requires-Dist: scipy (>=1.14.1,<2.0.0)
|
20
|
+
Requires-Dist: tables (>=3.10.1,<4.0.0)
|
20
21
|
Project-URL: Repository, https://github.com/Ruberhauptmann/quant-met
|
21
22
|
Description-Content-Type: text/markdown
|
22
23
|
|
@@ -28,7 +29,7 @@ SPDX-License-Identifier: MIT
|
|
28
29
|
|
29
30
|
# quant-met
|
30
31
|
|
31
|
-
[](https://github.com/Ruberhauptmann/quant-met/actions/workflows/unit_tests.yml)
|
32
33
|
[](https://coveralls.io/github/Ruberhauptmann/quant-met?branch=main)
|
33
34
|
[](https://pypi.org/project/quant-met/)
|
34
35
|
[](https://pypi.org/project/quant-met/)
|
@@ -1,13 +1,15 @@
|
|
1
1
|
quant_met/__init__.py,sha256=ZO1UFz1awUYTI7B9ZkBwucvDz7GMGXnLLUGnEwLBhkc,155
|
2
2
|
quant_met/cli/__init__.py,sha256=nGFXhK8zWyEKQtsQTyJWfEOLFOHTCjZnfEcrVb2dARc,254
|
3
|
-
quant_met/cli/
|
4
|
-
quant_met/cli/
|
3
|
+
quant_met/cli/_utils.py,sha256=n_aP8_4sZXgPwBxngDcKozfdgYJL6VTwOn9qFLKrnzY,941
|
4
|
+
quant_met/cli/crit_temp.py,sha256=hmPIvRD83ysvFOyMaUFZfv1IBy81ghV-7MluGx_Nv1Q,1843
|
5
|
+
quant_met/cli/main.py,sha256=lVAPGPUZtzyX6QKPEFYyDKFWYhQ30dMXjOEq5VdTa7I,1871
|
6
|
+
quant_met/cli/scf.py,sha256=wHilJRBk7_8nOheJpGk1ZeBOWu4UF9oDVI4SjHptQgY,1464
|
5
7
|
quant_met/geometry/__init__.py,sha256=5BLliTnMzlzPrjzmphQ_EpTE6f6dF-uXgQU_Qj8sBoI,592
|
6
8
|
quant_met/geometry/base_lattice.py,sha256=dUBk3167cppy5nUNSEbXq57rwgbVnIen20jC_vrhomA,2642
|
7
9
|
quant_met/geometry/bz_path.py,sha256=q_eNhKYjhKLeFNjio8BdKVsseO6slQKlwKKSQQYTVJQ,2497
|
8
10
|
quant_met/geometry/graphene.py,sha256=AIKI2ice7LiKk5LHS27w97FkUds0UFV7EVNML3W5D28,1623
|
9
11
|
quant_met/geometry/square.py,sha256=lAEJ2R_2VBBPI_Bc-x-KhPE5r8AGoY1RgAx8GdoqdNY,1561
|
10
|
-
quant_met/mean_field/__init__.py,sha256=
|
12
|
+
quant_met/mean_field/__init__.py,sha256=RqsqT4kXs2tQxbZZd1_NP2NGx_3RKcpQHNdwddCXg9E,736
|
11
13
|
quant_met/mean_field/_utils.py,sha256=7hr0DDSdIqjft5Jjluvbw_HGoNLWgYJTxyuPJJvhBnc,356
|
12
14
|
quant_met/mean_field/hamiltonians/__init__.py,sha256=kLe31GiWYvPshl2-tpjEz0AHct2S1AuwRakAK2XDNSg,681
|
13
15
|
quant_met/mean_field/hamiltonians/base_hamiltonian.py,sha256=_GZLmNAcRAu6NGCM8PnwacPV9AlOxrGLo0vdgrcoBvM,18295
|
@@ -17,17 +19,18 @@ quant_met/mean_field/hamiltonians/one_band_tight_binding.py,sha256=SXHPoVd_zyevN
|
|
17
19
|
quant_met/mean_field/hamiltonians/three_band_tight_binding.py,sha256=MuOxUTPPBENjKBotPVQH-8343y4dv73jtZXo-w8mJsA,3282
|
18
20
|
quant_met/mean_field/hamiltonians/two_band_tight_binding.py,sha256=Vk01wY1UP4V1yYHZ9RmlbB0cybPJjGlrBUkR8d3o3j8,2852
|
19
21
|
quant_met/mean_field/quantum_metric.py,sha256=2yRu2bfgMxgPcVqasmqfgUy8-O7gXJwJI7ziuvIShXU,2580
|
20
|
-
quant_met/mean_field/
|
22
|
+
quant_met/mean_field/search_crit_temp.py,sha256=zgAvkwNrH0PsjDnhRt8oRqy372yA_Z2g33BYDfqwv7U,7622
|
23
|
+
quant_met/mean_field/self_consistency.py,sha256=uk80FK7b1VVsFcUreGih11EMGXs45pkZ567g0bTNYwU,3140
|
21
24
|
quant_met/mean_field/superfluid_weight.py,sha256=0T_vkJB9AvjeaPG_y5h_3ZHh-0MCefeXnaPOn-hYjKw,4127
|
22
|
-
quant_met/parameters/__init__.py,sha256=
|
23
|
-
quant_met/parameters/hamiltonians.py,sha256=
|
24
|
-
quant_met/parameters/main.py,sha256=
|
25
|
+
quant_met/parameters/__init__.py,sha256=Urw9tGQkHgNogcqheIVoZYLka9Wao5FdwbvUK3-5qGw,1007
|
26
|
+
quant_met/parameters/hamiltonians.py,sha256=E26X8FDnuruSRwV32yPn0CKhVr0Kxs9K3QBc3MMDnHI,6028
|
27
|
+
quant_met/parameters/main.py,sha256=hGcJvRixkXuUk9MytAs0S1L2VvcJlT8qVG1g7NZOjlE,2126
|
25
28
|
quant_met/plotting/__init__.py,sha256=HEt2KKhUOR1he2cKL9GLfGfqN87Q6jl_AKylGC20U4g,544
|
26
29
|
quant_met/plotting/plotting.py,sha256=ueFKhGK2mo-_JKifhRlgT6WDuEbKSMwDaTNnl70tCZQ,6583
|
27
30
|
quant_met/utils.py,sha256=JG_tShSL1JIi-Fn-N6mVD6J0sl7Egf-zuHnOSEKu7VA,1666
|
28
|
-
quant_met-0.0.
|
29
|
-
quant_met-0.0.
|
30
|
-
quant_met-0.0.
|
31
|
-
quant_met-0.0.
|
32
|
-
quant_met-0.0.
|
33
|
-
quant_met-0.0.
|
31
|
+
quant_met-0.0.13.dist-info/LICENSE.txt,sha256=QO_duPQihSJlaxSLxPAXo52X3esROP5wBkhxqBd1Z4E,1104
|
32
|
+
quant_met-0.0.13.dist-info/LICENSES/MIT.txt,sha256=QO_duPQihSJlaxSLxPAXo52X3esROP5wBkhxqBd1Z4E,1104
|
33
|
+
quant_met-0.0.13.dist-info/METADATA,sha256=K-nUsnfgsboAGyWMRjur35KHn36RezKca_viaJPMQIg,2097
|
34
|
+
quant_met-0.0.13.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
35
|
+
quant_met-0.0.13.dist-info/entry_points.txt,sha256=fuVnEk5wiqPMEhn-Cc7q0Hdk2s_OniOn0zfdFPicH4Y,47
|
36
|
+
quant_met-0.0.13.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|