quant-met 0.1.1__py3-none-any.whl → 0.1.3__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.
@@ -9,7 +9,7 @@ def bdg_hamiltonian(
9
9
  hamiltonian: sisl.Hamiltonian,
10
10
  k: npt.NDArray[np.floating],
11
11
  delta_orbital_basis: npt.NDArray[np.complexfloating],
12
- q: npt.NDArray[np.floating] | None = None,
12
+ q: npt.NDArray[np.floating],
13
13
  ) -> npt.NDArray[np.complexfloating]:
14
14
  """
15
15
  Construct the BdG Hamiltonian at momentum k.
@@ -34,9 +34,6 @@ def bdg_hamiltonian(
34
34
  n_k_points = k.shape[0]
35
35
  n_orbitals = hamiltonian.no
36
36
 
37
- if q is None:
38
- q = np.zeros(3)
39
-
40
37
  h_bdg = np.zeros((n_k_points, 2 * n_orbitals, 2 * n_orbitals), dtype=np.complex128)
41
38
 
42
39
  for i, kpt in enumerate(k):
@@ -58,7 +55,7 @@ def diagonalize_bdg(
58
55
  hamiltonian: sisl.Hamiltonian,
59
56
  kgrid: sisl.MonkhorstPack,
60
57
  delta_orbital_basis: np.ndarray,
61
- q: npt.NDArray[np.floating] | None,
58
+ q: npt.NDArray[np.floating],
62
59
  ) -> tuple[npt.NDArray[np.float64], npt.NDArray[np.complex128]]:
63
60
  """Diagonalizes the BdG Hamiltonian.
64
61
 
@@ -14,7 +14,7 @@ def gap_equation( # noqa: PLR0913
14
14
  hubbard_int_orbital_basis: npt.NDArray[np.float64],
15
15
  delta_orbital_basis: npt.NDArray[np.complex128],
16
16
  kgrid: sisl.MonkhorstPack,
17
- q: npt.NDArray[np.float64] | None,
17
+ q: npt.NDArray[np.float64],
18
18
  ) -> npt.NDArray[np.complexfloating]:
19
19
  """Gap equation.
20
20
 
@@ -24,7 +24,9 @@ def calculate_superfluid_weight(
24
24
  k_tuple = tuple(k_point)
25
25
 
26
26
  # Solve BdG problem
27
- bdg_h = bdg_hamiltonian(hamiltonian, k_point, delta_orbital_basis)
27
+ bdg_h = bdg_hamiltonian(
28
+ hamiltonian, k_point, delta_orbital_basis, q=np.array([0.0, 0.0, 0.0])
29
+ )
28
30
  energies, wavefuncs = np.linalg.eigh(bdg_h)
29
31
 
30
32
  # Cache coefficient tensor
@@ -44,7 +44,8 @@ def q_analysis(parameters: Parameters) -> None:
44
44
  ) = routines.get_lengths_vs_temp(q_data=q_data, hamiltonian=hamiltonian)
45
45
 
46
46
  result_file = Path(f"{parameters.control.outdir}/{parameters.control.prefix}_sc_lengths.hdf5")
47
- result_file.unlink()
47
+ if result_file.exists():
48
+ result_file.unlink()
48
49
  lengths_vs_temp.to_hdf(result_file, key="lengths_vs_temp")
49
50
  gap_and_current_fig.savefig(
50
51
  f"{parameters.control.outdir}/{parameters.control.prefix}_gap_and_current_vs_q.pdf",
quant_met/cli/q_loop.py CHANGED
@@ -40,10 +40,13 @@ def q_loop(parameters: Parameters) -> None:
40
40
  delta_vs_temp, critical_temperatures, fit_fig = routines.search_crit_temp(
41
41
  hamiltonian=hamiltonian,
42
42
  kgrid=k_grid_obj,
43
- hubbard_int_orbital_basis=np.array(parameters.control.crit_temp.hubbard_int_orbital_basis),
43
+ hubbard_int_orbital_basis=np.array(
44
+ parameters.control.crit_temp.hubbard_int_orbital_basis
45
+ ),
44
46
  epsilon=parameters.control.crit_temp.conv_treshold,
45
47
  max_iter=parameters.control.crit_temp.max_iter,
46
48
  n_temp_points=20,
49
+ q=np.array([0.0, 0.0, 0.0]),
47
50
  )
48
51
  logger.info("Search for T_C completed successfully.")
49
52
  logger.info("Obtained T_Cs: %s", critical_temperatures)
@@ -25,7 +25,7 @@ class SCF(ControlBase):
25
25
  calculation: Literal["scf"]
26
26
  beta: float
27
27
  calculate_additional: bool = False
28
- q: FloatList | None = Field(..., min_length=2, max_length=2)
28
+ q: FloatList = [0.0, 0.0, 0.0]
29
29
 
30
30
 
31
31
  class CritTemp(ControlBase):
@@ -33,7 +33,7 @@ class CritTemp(ControlBase):
33
33
 
34
34
  calculation: Literal["crit-temp"]
35
35
  n_temp_points: int = 50
36
- q: FloatList | None = Field(..., min_length=2, max_length=2)
36
+ q: FloatList = [0.0, 0.0, 0.0]
37
37
 
38
38
 
39
39
  class QLoop(ControlBase):
@@ -136,9 +136,9 @@ def _gap_for_temp( # noqa: PLR0913
136
136
  kgrid: sisl.MonkhorstPack,
137
137
  hubbard_int_orbital_basis: npt.NDArray[np.float64],
138
138
  epsilon: float,
139
+ q: npt.NDArray[np.float64],
139
140
  max_iter: int = 1000,
140
141
  delta_init: npt.NDArray[np.complex128] | None = None,
141
- q: npt.NDArray[np.float64] | None = None,
142
142
  ) -> dict[str, Any] | None: # pragma: no cover
143
143
  beta = np.inf if temp == 0 else 1 / temp
144
144
  try:
@@ -170,7 +170,7 @@ def search_crit_temp( # noqa: PLR0913
170
170
  epsilon: float,
171
171
  max_iter: int,
172
172
  n_temp_points: int,
173
- q: npt.NDArray[np.float64] | None = None,
173
+ q: npt.NDArray[np.float64],
174
174
  beta_init: float | None = None,
175
175
  ) -> tuple[pd.DataFrame, list[float], matplotlib.figure.Figure]: # pragma: no cover
176
176
  """Search for critical temperature."""
@@ -18,9 +18,9 @@ def self_consistency_loop( # noqa: PLR0913
18
18
  beta: float,
19
19
  hubbard_int_orbital_basis: npt.NDArray[np.float64],
20
20
  epsilon: float,
21
+ q: npt.NDArray[np.float64],
21
22
  max_iter: int = 1000,
22
23
  delta_init: npt.NDArray[np.complex128] | None = None,
23
- q: npt.NDArray[np.float64] | None = None,
24
24
  ) -> ndarray[tuple[int, ...], dtype[complexfloating]]:
25
25
  """Self-consistently solves the gap equation for a given Hamiltonian.
26
26
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quant-met
3
- Version: 0.1.1
3
+ Version: 0.1.3
4
4
  Summary: Calculate superconductivity in flat-band systems.
5
5
  Author-email: Tjark Sievers <tjarksievers@icloud.com>
6
6
  License-File: LICENSE.txt
@@ -1,28 +1,28 @@
1
1
  quant_met/__init__.py,sha256=9WVEpcOuJ6ObayeK9u9Vkm2D-iPyb5Olc4PZdLWPORk,186
2
2
  quant_met/utils.py,sha256=pr-J_ElUDKxmSdErxsz4Eclvojoejbaup-Fg12QKMVQ,1989
3
3
  quant_met/bdg/__init__.py,sha256=RHxvGyCTDeK4vlIm807K9wJkLOI0jGA3ibuq0YRfo74,605
4
- quant_met/bdg/bdg_hamiltonian.py,sha256=6zKW_a7XVXYk61RFvJjp_av4Gh7KSMqLUV1Ir8iS1sY,2708
5
- quant_met/bdg/gap_equation.py,sha256=VyGbQxNxjbUkp-NHzGs3-5vejc6CcBfvmtXREWRS3eI,3372
4
+ quant_met/bdg/bdg_hamiltonian.py,sha256=G_BwiCTm1s47Gr_ggT7Oj92zfoOaKQAMrIcZMU4ow_Q,2644
5
+ quant_met/bdg/gap_equation.py,sha256=d1hgrgVyedqmnITpT2OhFnaf-9q659cPwHl_MqNYVA0,3365
6
6
  quant_met/bdg/sc_current.py,sha256=fRX4KH1J7IY1T8Oxrpd_0RJd8fvPDNeP3yCg-UwRLpI,1840
7
- quant_met/bdg/superfluid_weight.py,sha256=rLS6fK41Pt8aXxPL0KNVvK0dMWwYdbZ0eAqBEoGvAQ8,4207
7
+ quant_met/bdg/superfluid_weight.py,sha256=xhd-lb4W24QU7MVay65V5Tl4cO_rkKTUdyM856eG3tg,4274
8
8
  quant_met/cli/__init__.py,sha256=11q_R4KoAKZy2EOuUgnAn4GxbS9yyTA6nSjKpDl-UjI,175
9
9
  quant_met/cli/crit_temp.py,sha256=l4jPXY07z75FD7xgACrj_C2B3t3xX-yQeWlcnkEGIAA,2179
10
10
  quant_met/cli/main.py,sha256=DNgXguBfVpp-pddmN-RKePeO1R2Dsr_b97BKei1MMG0,2074
11
- quant_met/cli/q_analysis.py,sha256=H-3o-of_xEv3c1uUqtREGKroY-pk8Yu7RWXmLxi0xpU,1986
12
- quant_met/cli/q_loop.py,sha256=WIwGAqP00zzePPtU3lrN0M4A4OP9miHbiT32omTVW0c,3696
11
+ quant_met/cli/q_analysis.py,sha256=eRp8wxXz828BfanhtgO0vEHgITR1BAIjINWwApuwV80,2019
12
+ quant_met/cli/q_loop.py,sha256=HCAjgRicUceHK8X4h6pTdR_mTIHUHY3b70kOB-TWCns,3767
13
13
  quant_met/cli/scf.py,sha256=jpFoIpC0ghf48lK7SfNeTXXADEtyCzv6kzyMvdcBF1Y,3283
14
14
  quant_met/parameters/__init__.py,sha256=d1XBoH8siW0fNRz5I8tpI2-JQfiSjadFBcmQANV97Zk,448
15
- quant_met/parameters/control.py,sha256=ZxtAf35Gnb2LwooazcFrdb1d2b_sipGHIUtF5bZwTIg,1384
15
+ quant_met/parameters/control.py,sha256=65vDrbcUqv8UPzmdDI0yyKAto0UwavAGq5fTTUvfGM8,1324
16
16
  quant_met/parameters/main.py,sha256=P0o7f4o2woHNtLEqYJnO7dXdKEX3t_dsCky8-Sr_W88,977
17
17
  quant_met/quantum_geometry/__init__.py,sha256=RMD7pNHPFAJuOtUfNiV4XssA1RjL6h1eZBsh76Fc-8Y,185
18
18
  quant_met/quantum_geometry/qgt.py,sha256=jdYUxBOeKYYR96Zex2xIVOVCsT11HZ1NVrUBmmjTlLY,1358
19
19
  quant_met/routines/__init__.py,sha256=a8xHRD6j4v8lkrwGSzwmj4BHUg2tgTN0Hp0Vpu4863Y,479
20
20
  quant_met/routines/analyse_q_data.py,sha256=8q32GBB2ftYgdjWJ1_EpvcNJO9_Fn1kfKSaWLhIAJeY,8409
21
21
  quant_met/routines/loop_over_q.py,sha256=3yYhCf_Xo7ziT5Pj4HmLDvvq8crbb7-MdJOjmyluYao,4460
22
- quant_met/routines/search_crit_temp.py,sha256=phK2pJTibj8sgtxOghEJkurbG4xt2LRq23MTdfwygAE,9598
23
- quant_met/routines/self_consistency.py,sha256=nb-gRzyEd24kc6ZU2O53ov07Zg3pN6wSz-9jjo68RCM,3071
24
- quant_met-0.1.1.dist-info/METADATA,sha256=1b9db_Mgxi_W8tmD0yY4La_6y1MfvBoe7EvJaYPWxtA,1837
25
- quant_met-0.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
26
- quant_met-0.1.1.dist-info/entry_points.txt,sha256=1Al3Kt-cMeQxwMp84ZSNL0qFwlbOVBu1o8A19MH8lEU,48
27
- quant_met-0.1.1.dist-info/licenses/LICENSE.txt,sha256=QO_duPQihSJlaxSLxPAXo52X3esROP5wBkhxqBd1Z4E,1104
28
- quant_met-0.1.1.dist-info/RECORD,,
22
+ quant_met/routines/search_crit_temp.py,sha256=MT5feb-wLUk7zdVbnslL6g0KWKE1fg5_IwG39Fe6qLA,9570
23
+ quant_met/routines/self_consistency.py,sha256=woZmO1TEIE7Da14ASIXZ7LoMVjIKcB_CkVsqGJvir7c,3057
24
+ quant_met-0.1.3.dist-info/METADATA,sha256=yA81tnOZVlpxn4_YfHTpgW_Fs74KCKryjLfl_7PBtZg,1837
25
+ quant_met-0.1.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
26
+ quant_met-0.1.3.dist-info/entry_points.txt,sha256=1Al3Kt-cMeQxwMp84ZSNL0qFwlbOVBu1o8A19MH8lEU,48
27
+ quant_met-0.1.3.dist-info/licenses/LICENSE.txt,sha256=QO_duPQihSJlaxSLxPAXo52X3esROP5wBkhxqBd1Z4E,1104
28
+ quant_met-0.1.3.dist-info/RECORD,,