quant-met 0.0.13__tar.gz → 0.0.14__tar.gz

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.
Files changed (35) hide show
  1. {quant_met-0.0.13 → quant_met-0.0.14}/PKG-INFO +1 -1
  2. {quant_met-0.0.13 → quant_met-0.0.14}/pyproject.toml +1 -1
  3. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/cli/crit_temp.py +7 -2
  4. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/mean_field/search_crit_temp.py +25 -5
  5. {quant_met-0.0.13 → quant_met-0.0.14}/LICENSE.txt +0 -0
  6. {quant_met-0.0.13 → quant_met-0.0.14}/LICENSES/MIT.txt +0 -0
  7. {quant_met-0.0.13 → quant_met-0.0.14}/README.md +0 -0
  8. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/__init__.py +0 -0
  9. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/cli/__init__.py +0 -0
  10. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/cli/_utils.py +0 -0
  11. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/cli/main.py +0 -0
  12. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/cli/scf.py +0 -0
  13. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/geometry/__init__.py +0 -0
  14. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/geometry/base_lattice.py +0 -0
  15. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/geometry/bz_path.py +0 -0
  16. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/geometry/graphene.py +0 -0
  17. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/geometry/square.py +0 -0
  18. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/mean_field/__init__.py +0 -0
  19. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/mean_field/_utils.py +0 -0
  20. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/mean_field/hamiltonians/__init__.py +0 -0
  21. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/mean_field/hamiltonians/base_hamiltonian.py +0 -0
  22. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/mean_field/hamiltonians/dressed_graphene.py +0 -0
  23. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/mean_field/hamiltonians/graphene.py +0 -0
  24. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/mean_field/hamiltonians/one_band_tight_binding.py +0 -0
  25. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/mean_field/hamiltonians/three_band_tight_binding.py +0 -0
  26. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/mean_field/hamiltonians/two_band_tight_binding.py +0 -0
  27. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/mean_field/quantum_metric.py +0 -0
  28. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/mean_field/self_consistency.py +0 -0
  29. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/mean_field/superfluid_weight.py +0 -0
  30. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/parameters/__init__.py +0 -0
  31. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/parameters/hamiltonians.py +0 -0
  32. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/parameters/main.py +0 -0
  33. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/plotting/__init__.py +0 -0
  34. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/plotting/plotting.py +0 -0
  35. {quant_met-0.0.13 → quant_met-0.0.14}/src/quant_met/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: quant-met
3
- Version: 0.0.13
3
+ Version: 0.0.14
4
4
  Summary: Calculate superconductivity in flat-band systems.
5
5
  Home-page: https://quant-met.tjarksievers.de
6
6
  Author: Tjark Sievers
@@ -8,7 +8,7 @@ requires-python = ">=3.11,<3.13"
8
8
 
9
9
  [tool.poetry]
10
10
  name = "quant-met"
11
- version = "0.0.13"
11
+ version = "0.0.14"
12
12
  description = "Calculate superconductivity in flat-band systems."
13
13
  authors = ["Tjark Sievers <tsievers@physnet.uni-hamburg.de>"]
14
14
  homepage = "https://quant-met.tjarksievers.de"
@@ -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(result_path / f"{parameters.control.prefix}_T_C_fit.pdf", bbox_inches="tight")
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
- temp: float,
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 = 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)
@@ -51,10 +53,28 @@ def _get_bounds(
51
53
  temp = 2 * temp
52
54
  logger.info("Found temperature with nonzero gap.")
53
55
  found_nonzero_gap = True
54
- else:
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
61
+ else:
62
+ logger.info(
63
+ "Gap is neither zero nor equal to the nonzero gap. Increasing temperature."
64
+ )
65
+ temp = 2 * temp
56
66
  else:
57
- temp = 0.5 * temp
67
+ logger.info("No data found for temperature %s. Reducing temperature.", temp)
68
+ temp = 0.7 * temp
69
+ if found_zero_gap and not found_nonzero_gap and temp > initial_temp:
70
+ logger.info("Switching direction to decrease temperature.")
71
+ temp = initial_temp / 2
72
+ direction = "down"
73
+ if found_nonzero_gap and not found_zero_gap and temp < initial_temp:
74
+ logger.info("Switching direction to increase temperature.")
75
+ temp = 2 * initial_temp
76
+ direction = "up"
77
+
58
78
  iterations += 1
59
79
  return delta_vs_temp_list, zero_gap_temp, nonzero_gap_temp
60
80
 
@@ -148,10 +168,10 @@ def search_crit_temp(
148
168
  _gap_for_temp, h=h, k_space_grid=k_space_grid, epsilon=epsilon, max_iter=max_iter
149
169
  )
150
170
 
171
+ logger.info("Calculating zero temperature gap")
151
172
  data_dict = gap_for_temp_partial(0)
152
173
  assert data_dict is not None
153
174
 
154
- logger.info("Calculating zero temperature gap")
155
175
  zero_temperature_gap = np.array(
156
176
  [data_dict[key] for key in data_dict if key.startswith("delta")]
157
177
  )
File without changes
File without changes
File without changes