quant-met 0.0.13__py3-none-any.whl → 0.0.15__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/crit_temp.py +7 -2
- quant_met/mean_field/search_crit_temp.py +34 -10
- {quant_met-0.0.13.dist-info → quant_met-0.0.15.dist-info}/METADATA +1 -1
- {quant_met-0.0.13.dist-info → quant_met-0.0.15.dist-info}/RECORD +8 -8
- {quant_met-0.0.13.dist-info → quant_met-0.0.15.dist-info}/LICENSE.txt +0 -0
- {quant_met-0.0.13.dist-info → quant_met-0.0.15.dist-info}/LICENSES/MIT.txt +0 -0
- {quant_met-0.0.13.dist-info → quant_met-0.0.15.dist-info}/WHEEL +0 -0
- {quant_met-0.0.13.dist-info → quant_met-0.0.15.dist-info}/entry_points.txt +0 -0
quant_met/cli/crit_temp.py
CHANGED
@@ -44,12 +44,17 @@ def crit_temp(parameters: Parameters) -> None:
|
|
44
44
|
logger.info("Search for T_C completed successfully.")
|
45
45
|
logger.info("Obtained T_Cs: %s", critical_temperatures)
|
46
46
|
|
47
|
-
fit_fig.savefig(
|
47
|
+
fit_fig.savefig(
|
48
|
+
result_path / f"{parameters.control.prefix}_critical_temperatures_fit.pdf",
|
49
|
+
bbox_inches="tight",
|
50
|
+
)
|
48
51
|
|
49
|
-
result_file = result_path / f"{parameters.control.prefix}.hdf5"
|
52
|
+
result_file = result_path / f"{parameters.control.prefix}_critical_temperatures.hdf5"
|
50
53
|
delta_vs_temp.to_hdf(result_file, key="delta_vs_temp")
|
51
54
|
with h5py.File(result_file, mode="a") as file:
|
52
55
|
for orbital, crit_temp_orbital in enumerate(critical_temperatures):
|
53
56
|
file.attrs[f"T_C_{orbital}"] = crit_temp_orbital
|
57
|
+
hamiltonian_file = result_path / f"{parameters.control.prefix}_sample_hamiltonian.hdf5"
|
58
|
+
h.save(hamiltonian_file)
|
54
59
|
|
55
60
|
logger.info("Results saved to %s", result_file)
|
@@ -26,14 +26,16 @@ logger = logging.getLogger(__name__)
|
|
26
26
|
|
27
27
|
|
28
28
|
def _get_bounds(
|
29
|
-
|
29
|
+
initial_temp: float,
|
30
30
|
gap_for_temp_partial: partial[dict[str, Any] | None],
|
31
31
|
zero_temperature_gap: npt.NDArray[np.complex64],
|
32
32
|
) -> tuple[list[dict[str, Any]], float, float]: # pragma: no cover
|
33
33
|
delta_vs_temp_list = []
|
34
|
-
zero_gap_temp = nonzero_gap_temp =
|
34
|
+
zero_gap_temp = nonzero_gap_temp = 0.0
|
35
35
|
found_zero_gap = False
|
36
36
|
found_nonzero_gap = False
|
37
|
+
temp = initial_temp
|
38
|
+
direction = "down"
|
37
39
|
iterations = 0
|
38
40
|
while (found_zero_gap and found_nonzero_gap) is False and iterations < 100:
|
39
41
|
logger.info("Trying temperature: %s", temp)
|
@@ -42,19 +44,41 @@ def _get_bounds(
|
|
42
44
|
delta_vs_temp_list.append(data_dict)
|
43
45
|
gap = np.array([data_dict[key] for key in data_dict if key.startswith("delta")])
|
44
46
|
if np.allclose(gap, 0):
|
45
|
-
zero_gap_temp = temp
|
46
|
-
temp = 0.5 * temp
|
47
47
|
logger.info("Found temperature with zero gap.")
|
48
|
+
zero_gap_temp = temp
|
48
49
|
found_zero_gap = True
|
49
|
-
|
50
|
-
|
51
|
-
temp = 2 * temp
|
50
|
+
temp = 0.5 * temp
|
51
|
+
elif np.allclose(gap, zero_temperature_gap, atol=np.min(np.abs(zero_temperature_gap))):
|
52
52
|
logger.info("Found temperature with nonzero gap.")
|
53
|
+
nonzero_gap_temp = temp
|
53
54
|
found_nonzero_gap = True
|
54
|
-
|
55
|
+
temp = 2 * temp
|
56
|
+
elif direction == "down":
|
57
|
+
logger.info(
|
58
|
+
"Gap is neither zero nor equal to the nonzero gap. Reducing temperature."
|
59
|
+
)
|
55
60
|
temp = 0.5 * temp
|
56
|
-
|
61
|
+
else:
|
62
|
+
logger.info(
|
63
|
+
"Gap is neither zero nor equal to the nonzero gap. Increasing temperature."
|
64
|
+
)
|
65
|
+
temp = 2 * temp
|
66
|
+
elif direction == "down":
|
67
|
+
logger.info("No data found for temperature %s. Reducing temperature.", temp)
|
57
68
|
temp = 0.5 * temp
|
69
|
+
else:
|
70
|
+
logger.info("No data found for temperature %s. Increasing temperature.", temp)
|
71
|
+
temp = 2 * temp
|
72
|
+
|
73
|
+
if found_zero_gap and direction == "up" and not found_nonzero_gap:
|
74
|
+
logger.info("Switching direction to decrease temperature.")
|
75
|
+
temp = initial_temp / 2
|
76
|
+
direction = "down"
|
77
|
+
if found_nonzero_gap and direction == "down" and not found_zero_gap:
|
78
|
+
logger.info("Switching direction to increase temperature.")
|
79
|
+
temp = 2 * initial_temp
|
80
|
+
direction = "up"
|
81
|
+
|
58
82
|
iterations += 1
|
59
83
|
return delta_vs_temp_list, zero_gap_temp, nonzero_gap_temp
|
60
84
|
|
@@ -148,10 +172,10 @@ def search_crit_temp(
|
|
148
172
|
_gap_for_temp, h=h, k_space_grid=k_space_grid, epsilon=epsilon, max_iter=max_iter
|
149
173
|
)
|
150
174
|
|
175
|
+
logger.info("Calculating zero temperature gap")
|
151
176
|
data_dict = gap_for_temp_partial(0)
|
152
177
|
assert data_dict is not None
|
153
178
|
|
154
|
-
logger.info("Calculating zero temperature gap")
|
155
179
|
zero_temperature_gap = np.array(
|
156
180
|
[data_dict[key] for key in data_dict if key.startswith("delta")]
|
157
181
|
)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
quant_met/__init__.py,sha256=ZO1UFz1awUYTI7B9ZkBwucvDz7GMGXnLLUGnEwLBhkc,155
|
2
2
|
quant_met/cli/__init__.py,sha256=nGFXhK8zWyEKQtsQTyJWfEOLFOHTCjZnfEcrVb2dARc,254
|
3
3
|
quant_met/cli/_utils.py,sha256=n_aP8_4sZXgPwBxngDcKozfdgYJL6VTwOn9qFLKrnzY,941
|
4
|
-
quant_met/cli/crit_temp.py,sha256=
|
4
|
+
quant_met/cli/crit_temp.py,sha256=t9sPZKORl6dpa1UNAOMH2gDmeQxf80iFH7p_L3FI5q8,2027
|
5
5
|
quant_met/cli/main.py,sha256=lVAPGPUZtzyX6QKPEFYyDKFWYhQ30dMXjOEq5VdTa7I,1871
|
6
6
|
quant_met/cli/scf.py,sha256=wHilJRBk7_8nOheJpGk1ZeBOWu4UF9oDVI4SjHptQgY,1464
|
7
7
|
quant_met/geometry/__init__.py,sha256=5BLliTnMzlzPrjzmphQ_EpTE6f6dF-uXgQU_Qj8sBoI,592
|
@@ -19,7 +19,7 @@ quant_met/mean_field/hamiltonians/one_band_tight_binding.py,sha256=SXHPoVd_zyevN
|
|
19
19
|
quant_met/mean_field/hamiltonians/three_band_tight_binding.py,sha256=MuOxUTPPBENjKBotPVQH-8343y4dv73jtZXo-w8mJsA,3282
|
20
20
|
quant_met/mean_field/hamiltonians/two_band_tight_binding.py,sha256=Vk01wY1UP4V1yYHZ9RmlbB0cybPJjGlrBUkR8d3o3j8,2852
|
21
21
|
quant_met/mean_field/quantum_metric.py,sha256=2yRu2bfgMxgPcVqasmqfgUy8-O7gXJwJI7ziuvIShXU,2580
|
22
|
-
quant_met/mean_field/search_crit_temp.py,sha256=
|
22
|
+
quant_met/mean_field/search_crit_temp.py,sha256=3vf9qjB3t3xnn8VpJ9efZ2XrdLTpOpG6nLSEsulN0KU,8745
|
23
23
|
quant_met/mean_field/self_consistency.py,sha256=uk80FK7b1VVsFcUreGih11EMGXs45pkZ567g0bTNYwU,3140
|
24
24
|
quant_met/mean_field/superfluid_weight.py,sha256=0T_vkJB9AvjeaPG_y5h_3ZHh-0MCefeXnaPOn-hYjKw,4127
|
25
25
|
quant_met/parameters/__init__.py,sha256=Urw9tGQkHgNogcqheIVoZYLka9Wao5FdwbvUK3-5qGw,1007
|
@@ -28,9 +28,9 @@ quant_met/parameters/main.py,sha256=hGcJvRixkXuUk9MytAs0S1L2VvcJlT8qVG1g7NZOjlE,
|
|
28
28
|
quant_met/plotting/__init__.py,sha256=HEt2KKhUOR1he2cKL9GLfGfqN87Q6jl_AKylGC20U4g,544
|
29
29
|
quant_met/plotting/plotting.py,sha256=ueFKhGK2mo-_JKifhRlgT6WDuEbKSMwDaTNnl70tCZQ,6583
|
30
30
|
quant_met/utils.py,sha256=JG_tShSL1JIi-Fn-N6mVD6J0sl7Egf-zuHnOSEKu7VA,1666
|
31
|
-
quant_met-0.0.
|
32
|
-
quant_met-0.0.
|
33
|
-
quant_met-0.0.
|
34
|
-
quant_met-0.0.
|
35
|
-
quant_met-0.0.
|
36
|
-
quant_met-0.0.
|
31
|
+
quant_met-0.0.15.dist-info/LICENSE.txt,sha256=QO_duPQihSJlaxSLxPAXo52X3esROP5wBkhxqBd1Z4E,1104
|
32
|
+
quant_met-0.0.15.dist-info/LICENSES/MIT.txt,sha256=QO_duPQihSJlaxSLxPAXo52X3esROP5wBkhxqBd1Z4E,1104
|
33
|
+
quant_met-0.0.15.dist-info/METADATA,sha256=72N8ib9JLU7WPuIFzVOBzUVkwIqh2kJcI43abg6Hego,2097
|
34
|
+
quant_met-0.0.15.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
35
|
+
quant_met-0.0.15.dist-info/entry_points.txt,sha256=fuVnEk5wiqPMEhn-Cc7q0Hdk2s_OniOn0zfdFPicH4Y,47
|
36
|
+
quant_met-0.0.15.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|