quant-met 0.0.16__py3-none-any.whl → 0.0.18__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/scf.py +27 -3
- quant_met/geometry/__init__.py +1 -1
- quant_met/geometry/base_lattice.py +6 -6
- quant_met/geometry/bz_path.py +6 -6
- quant_met/geometry/graphene.py +3 -3
- quant_met/geometry/square.py +3 -3
- quant_met/mean_field/__init__.py +2 -4
- quant_met/mean_field/hamiltonians/__init__.py +1 -1
- quant_met/mean_field/hamiltonians/base_hamiltonian.py +288 -52
- quant_met/mean_field/hamiltonians/dressed_graphene.py +6 -6
- quant_met/mean_field/hamiltonians/graphene.py +6 -6
- quant_met/mean_field/hamiltonians/one_band_tight_binding.py +6 -6
- quant_met/mean_field/hamiltonians/three_band_tight_binding.py +6 -6
- quant_met/mean_field/hamiltonians/two_band_tight_binding.py +6 -6
- quant_met/mean_field/quantum_metric.py +3 -3
- quant_met/mean_field/search_crit_temp.py +3 -3
- quant_met/mean_field/self_consistency.py +13 -9
- quant_met/parameters/__init__.py +5 -5
- quant_met/parameters/hamiltonians.py +8 -8
- quant_met/parameters/main.py +1 -0
- quant_met/plotting/__init__.py +1 -1
- quant_met/plotting/plotting.py +9 -9
- quant_met/utils.py +27 -5
- {quant_met-0.0.16.dist-info → quant_met-0.0.18.dist-info}/METADATA +21 -23
- quant_met-0.0.18.dist-info/RECORD +34 -0
- {quant_met-0.0.16.dist-info → quant_met-0.0.18.dist-info}/WHEEL +1 -1
- quant_met-0.0.18.dist-info/entry_points.txt +2 -0
- quant_met/mean_field/superfluid_weight.py +0 -123
- quant_met-0.0.16.dist-info/LICENSES/MIT.txt +0 -9
- quant_met-0.0.16.dist-info/RECORD +0 -36
- quant_met-0.0.16.dist-info/entry_points.txt +0 -3
- {quant_met-0.0.16.dist-info → quant_met-0.0.18.dist-info/licenses}/LICENSE.txt +0 -0
@@ -22,7 +22,7 @@ class ThreeBand(BaseHamiltonian[ThreeBandParameters]):
|
|
22
22
|
self.hopping = parameters.hopping
|
23
23
|
self.chemical_potential = parameters.chemical_potential
|
24
24
|
if parameters.delta is not None:
|
25
|
-
self.delta_orbital_basis =
|
25
|
+
self.delta_orbital_basis = parameters.delta.astype(np.complex128)
|
26
26
|
|
27
27
|
def setup_lattice(self, parameters: ThreeBandParameters) -> SquareLattice: # noqa: D102
|
28
28
|
return SquareLattice(lattice_constant=parameters.lattice_constant)
|
@@ -31,7 +31,7 @@ class ThreeBand(BaseHamiltonian[ThreeBandParameters]):
|
|
31
31
|
def get_parameters_model(cls) -> type[ThreeBandParameters]: # noqa: D102
|
32
32
|
return ThreeBandParameters
|
33
33
|
|
34
|
-
def hamiltonian(self, k: npt.NDArray[np.
|
34
|
+
def hamiltonian(self, k: npt.NDArray[np.floating]) -> npt.NDArray[np.complexfloating]: # noqa: D102
|
35
35
|
assert _check_valid_array(k)
|
36
36
|
hopping = self.hopping
|
37
37
|
lattice_constant = self.lattice.lattice_constant
|
@@ -39,7 +39,7 @@ class ThreeBand(BaseHamiltonian[ThreeBandParameters]):
|
|
39
39
|
if k.ndim == 1:
|
40
40
|
k = np.expand_dims(k, axis=0)
|
41
41
|
|
42
|
-
h = np.zeros((k.shape[0], self.number_of_bands, self.number_of_bands), dtype=np.
|
42
|
+
h = np.zeros((k.shape[0], self.number_of_bands, self.number_of_bands), dtype=np.complex128)
|
43
43
|
|
44
44
|
h[:, 0, 0] = (
|
45
45
|
-2 * hopping * (np.cos(k[:, 1] * lattice_constant) + np.cos(k[:, 0] * lattice_constant))
|
@@ -60,8 +60,8 @@ class ThreeBand(BaseHamiltonian[ThreeBandParameters]):
|
|
60
60
|
return h.squeeze()
|
61
61
|
|
62
62
|
def hamiltonian_derivative( # noqa: D102
|
63
|
-
self, k: npt.NDArray[np.
|
64
|
-
) -> npt.NDArray[np.
|
63
|
+
self, k: npt.NDArray[np.floating], direction: str
|
64
|
+
) -> npt.NDArray[np.complexfloating]:
|
65
65
|
assert _check_valid_array(k)
|
66
66
|
assert direction in ["x", "y"]
|
67
67
|
|
@@ -70,7 +70,7 @@ class ThreeBand(BaseHamiltonian[ThreeBandParameters]):
|
|
70
70
|
if k.ndim == 1:
|
71
71
|
k = np.expand_dims(k, axis=0)
|
72
72
|
|
73
|
-
h = np.zeros((k.shape[0], self.number_of_bands, self.number_of_bands), dtype=np.
|
73
|
+
h = np.zeros((k.shape[0], self.number_of_bands, self.number_of_bands), dtype=np.complex128)
|
74
74
|
|
75
75
|
if direction == "x":
|
76
76
|
h[:, 0, 0] = -2 * hopping * lattice_constant * np.sin(lattice_constant * k[:, 0])
|
@@ -22,7 +22,7 @@ class TwoBand(BaseHamiltonian[TwoBandParameters]):
|
|
22
22
|
self.hopping = parameters.hopping
|
23
23
|
self.chemical_potential = parameters.chemical_potential
|
24
24
|
if parameters.delta is not None:
|
25
|
-
self.delta_orbital_basis =
|
25
|
+
self.delta_orbital_basis = parameters.delta.astype(np.complex128)
|
26
26
|
|
27
27
|
def setup_lattice(self, parameters: TwoBandParameters) -> SquareLattice: # noqa: D102
|
28
28
|
return SquareLattice(lattice_constant=parameters.lattice_constant)
|
@@ -31,7 +31,7 @@ class TwoBand(BaseHamiltonian[TwoBandParameters]):
|
|
31
31
|
def get_parameters_model(cls) -> type[TwoBandParameters]: # noqa: D102
|
32
32
|
return TwoBandParameters
|
33
33
|
|
34
|
-
def hamiltonian(self, k: npt.NDArray[np.
|
34
|
+
def hamiltonian(self, k: npt.NDArray[np.floating]) -> npt.NDArray[np.complexfloating]: # noqa: D102
|
35
35
|
assert _check_valid_array(k)
|
36
36
|
hopping = self.hopping
|
37
37
|
lattice_constant = self.lattice.lattice_constant
|
@@ -39,7 +39,7 @@ class TwoBand(BaseHamiltonian[TwoBandParameters]):
|
|
39
39
|
if k.ndim == 1:
|
40
40
|
k = np.expand_dims(k, axis=0)
|
41
41
|
|
42
|
-
h = np.zeros((k.shape[0], self.number_of_bands, self.number_of_bands), dtype=np.
|
42
|
+
h = np.zeros((k.shape[0], self.number_of_bands, self.number_of_bands), dtype=np.complex128)
|
43
43
|
|
44
44
|
h[:, 0, 0] = (
|
45
45
|
-2 * hopping * (np.cos(k[:, 1] * lattice_constant) + np.cos(k[:, 0] * lattice_constant))
|
@@ -53,8 +53,8 @@ class TwoBand(BaseHamiltonian[TwoBandParameters]):
|
|
53
53
|
return h.squeeze()
|
54
54
|
|
55
55
|
def hamiltonian_derivative( # noqa: D102
|
56
|
-
self, k: npt.NDArray[np.
|
57
|
-
) -> npt.NDArray[np.
|
56
|
+
self, k: npt.NDArray[np.floating], direction: str
|
57
|
+
) -> npt.NDArray[np.complexfloating]:
|
58
58
|
assert _check_valid_array(k)
|
59
59
|
assert direction in ["x", "y"]
|
60
60
|
|
@@ -63,7 +63,7 @@ class TwoBand(BaseHamiltonian[TwoBandParameters]):
|
|
63
63
|
if k.ndim == 1:
|
64
64
|
k = np.expand_dims(k, axis=0)
|
65
65
|
|
66
|
-
h = np.zeros((k.shape[0], self.number_of_bands, self.number_of_bands), dtype=np.
|
66
|
+
h = np.zeros((k.shape[0], self.number_of_bands, self.number_of_bands), dtype=np.complex128)
|
67
67
|
|
68
68
|
if direction == "x":
|
69
69
|
h[:, 0, 0] = -2 * hopping * lattice_constant * np.sin(lattice_constant * k[:, 0])
|
@@ -12,8 +12,8 @@ from quant_met.parameters import GenericParameters
|
|
12
12
|
|
13
13
|
|
14
14
|
def quantum_metric(
|
15
|
-
h: BaseHamiltonian[GenericParameters], k: npt.NDArray[np.
|
16
|
-
) -> npt.NDArray[np.
|
15
|
+
h: BaseHamiltonian[GenericParameters], k: npt.NDArray[np.floating], bands: list[int]
|
16
|
+
) -> npt.NDArray[np.floating]:
|
17
17
|
"""Calculate the quantum metric (geometric tensor) for specified bands.
|
18
18
|
|
19
19
|
This function computes the quantum geometric tensor associated with
|
@@ -43,7 +43,7 @@ def quantum_metric(
|
|
43
43
|
|
44
44
|
number_k_points = len(k)
|
45
45
|
|
46
|
-
quantum_geom_tensor = np.zeros(shape=(2, 2), dtype=np.
|
46
|
+
quantum_geom_tensor = np.zeros(shape=(2, 2), dtype=np.complex128)
|
47
47
|
|
48
48
|
for band in bands:
|
49
49
|
for i, direction_1 in enumerate(["x", "y"]):
|
@@ -28,7 +28,7 @@ logger = logging.getLogger(__name__)
|
|
28
28
|
def _get_bounds(
|
29
29
|
initial_temp: float,
|
30
30
|
gap_for_temp_partial: partial[dict[str, Any] | None],
|
31
|
-
zero_temperature_gap: npt.NDArray[np.
|
31
|
+
zero_temperature_gap: npt.NDArray[np.complexfloating],
|
32
32
|
) -> tuple[list[dict[str, Any]], float, float]: # pragma: no cover
|
33
33
|
delta_vs_temp_list = []
|
34
34
|
zero_gap_temp = nonzero_gap_temp = 0.0
|
@@ -128,7 +128,7 @@ def _fit_for_crit_temp(
|
|
128
128
|
def _gap_for_temp(
|
129
129
|
temp: float,
|
130
130
|
h: BaseHamiltonian[GenericParameters],
|
131
|
-
k_space_grid: npt.NDArray[np.
|
131
|
+
k_space_grid: npt.NDArray[np.floating],
|
132
132
|
epsilon: float,
|
133
133
|
max_iter: int = 1000,
|
134
134
|
) -> dict[str, Any] | None: # pragma: no cover
|
@@ -155,7 +155,7 @@ def _gap_for_temp(
|
|
155
155
|
|
156
156
|
def search_crit_temp(
|
157
157
|
h: BaseHamiltonian[GenericParameters],
|
158
|
-
k_space_grid: npt.NDArray[np.
|
158
|
+
k_space_grid: npt.NDArray[np.floating],
|
159
159
|
epsilon: float,
|
160
160
|
max_iter: int,
|
161
161
|
n_temp_points: int,
|
@@ -17,9 +17,10 @@ logger = logging.getLogger(__name__)
|
|
17
17
|
|
18
18
|
def self_consistency_loop(
|
19
19
|
h: BaseHamiltonian[GenericParameters],
|
20
|
-
k_space_grid: npt.NDArray[np.
|
20
|
+
k_space_grid: npt.NDArray[np.floating],
|
21
21
|
epsilon: float,
|
22
22
|
max_iter: int = 1000,
|
23
|
+
delta_init: npt.NDArray[np.complex128] | None = None,
|
23
24
|
) -> BaseHamiltonian[GenericParameters]:
|
24
25
|
"""Self-consistently solves the gap equation for a given Hamiltonian.
|
25
26
|
|
@@ -35,12 +36,14 @@ def self_consistency_loop(
|
|
35
36
|
|
36
37
|
k_space_grid : :class:`numpy.ndarray`
|
37
38
|
A grid of points in the Brillouin zone at which the gap equation is evaluated.
|
38
|
-
See
|
39
39
|
|
40
40
|
epsilon : float
|
41
41
|
The convergence criterion. The loop will terminate when the change
|
42
42
|
in the delta orbital basis is less than this value.
|
43
43
|
|
44
|
+
delta_init : :class:`numpy.ndarray`
|
45
|
+
Initial gaps in orbital basis.
|
46
|
+
|
44
47
|
max_iter : int
|
45
48
|
Maximal number of iterations, default 300.
|
46
49
|
|
@@ -58,12 +61,13 @@ def self_consistency_loop(
|
|
58
61
|
"""
|
59
62
|
logger.info("Starting self-consistency loop.")
|
60
63
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
0.2 * rng.random(size=h.delta_orbital_basis.shape) - 1
|
65
|
-
|
66
|
-
|
64
|
+
if delta_init is None:
|
65
|
+
rng = np.random.default_rng()
|
66
|
+
delta_init = np.zeros(shape=h.delta_orbital_basis.shape, dtype=np.complex128)
|
67
|
+
delta_init += (0.2 * rng.random(size=h.delta_orbital_basis.shape) - 1) + 1.0j * (
|
68
|
+
0.2 * rng.random(size=h.delta_orbital_basis.shape) - 1
|
69
|
+
)
|
70
|
+
h.delta_orbital_basis = delta_init # type: ignore[assignment]
|
67
71
|
logger.debug("Initial gaps set to: %s", h.delta_orbital_basis)
|
68
72
|
|
69
73
|
iteration_count = 0
|
@@ -80,7 +84,7 @@ def self_consistency_loop(
|
|
80
84
|
logger.debug("New gaps computed: %s", new_gap)
|
81
85
|
|
82
86
|
if np.allclose(h.delta_orbital_basis, new_gap, atol=1e-10, rtol=epsilon):
|
83
|
-
h.delta_orbital_basis = new_gap
|
87
|
+
h.delta_orbital_basis = new_gap # type: ignore[assignment]
|
84
88
|
logger.info("Convergence achieved after %d iterations.", iteration_count)
|
85
89
|
return h
|
86
90
|
|
quant_met/parameters/__init__.py
CHANGED
@@ -36,14 +36,14 @@ from .hamiltonians import (
|
|
36
36
|
from .main import Control, KPoints, Parameters
|
37
37
|
|
38
38
|
__all__ = [
|
39
|
-
"Parameters",
|
40
39
|
"Control",
|
41
|
-
"KPoints",
|
42
|
-
"HamiltonianParameters",
|
43
40
|
"DressedGrapheneParameters",
|
41
|
+
"GenericParameters",
|
44
42
|
"GrapheneParameters",
|
43
|
+
"HamiltonianParameters",
|
44
|
+
"KPoints",
|
45
45
|
"OneBandParameters",
|
46
|
-
"
|
46
|
+
"Parameters",
|
47
47
|
"ThreeBandParameters",
|
48
|
-
"
|
48
|
+
"TwoBandParameters",
|
49
49
|
]
|
@@ -77,9 +77,9 @@ class DressedGrapheneParameters(HamiltonianParameters):
|
|
77
77
|
The lattice constant of the model.
|
78
78
|
chemical_potential : float
|
79
79
|
The chemical potential.
|
80
|
-
hubbard_int_orbital_basis : npt.NDArray[np.
|
80
|
+
hubbard_int_orbital_basis : npt.NDArray[np.floating]
|
81
81
|
Hubbard interaction in the orbital basis.
|
82
|
-
delta : npt.NDArray[np.
|
82
|
+
delta : npt.NDArray[np.complexfloating] | None
|
83
83
|
Initial value for gaps in orbital space.
|
84
84
|
"""
|
85
85
|
|
@@ -92,7 +92,7 @@ class DressedGrapheneParameters(HamiltonianParameters):
|
|
92
92
|
hubbard_int_orbital_basis: NDArray[Shape["3"], np.float64] = Field(
|
93
93
|
..., description="Hubbard interaction in orbital basis"
|
94
94
|
)
|
95
|
-
delta: NDArray[Shape["3"], np.
|
95
|
+
delta: NDArray[Shape["3"], np.complex128] | None = Field(
|
96
96
|
default=None, description="Initial value for gaps in orbital space"
|
97
97
|
)
|
98
98
|
|
@@ -115,7 +115,7 @@ class GrapheneParameters(HamiltonianParameters):
|
|
115
115
|
hubbard_int_orbital_basis: NDArray[Shape["2"], np.float64] = Field(
|
116
116
|
..., description="Hubbard interaction in orbital basis"
|
117
117
|
)
|
118
|
-
delta: NDArray[Shape["2"], np.
|
118
|
+
delta: NDArray[Shape["2"], np.complex128] | None = None
|
119
119
|
|
120
120
|
_check_positive_values = field_validator("hopping", "lattice_constant")(check_positive_values)
|
121
121
|
|
@@ -131,10 +131,10 @@ class OneBandParameters(HamiltonianParameters):
|
|
131
131
|
hopping: float
|
132
132
|
lattice_constant: float
|
133
133
|
chemical_potential: float
|
134
|
-
hubbard_int_orbital_basis: NDArray[Shape["1"], np.
|
134
|
+
hubbard_int_orbital_basis: NDArray[Shape["1"], np.floating] = Field(
|
135
135
|
..., description="Hubbard interaction in orbital basis"
|
136
136
|
)
|
137
|
-
delta: NDArray[Shape["1"], np.
|
137
|
+
delta: NDArray[Shape["1"], np.complex128] | None = None
|
138
138
|
|
139
139
|
_check_positive_values = field_validator("hopping", "lattice_constant")(check_positive_values)
|
140
140
|
|
@@ -153,7 +153,7 @@ class TwoBandParameters(HamiltonianParameters):
|
|
153
153
|
hubbard_int_orbital_basis: NDArray[Shape["2"], np.float64] = Field(
|
154
154
|
..., description="Hubbard interaction in orbital basis"
|
155
155
|
)
|
156
|
-
delta: NDArray[Shape["2"], np.
|
156
|
+
delta: NDArray[Shape["2"], np.complexfloating] | None = None
|
157
157
|
|
158
158
|
_check_positive_values = field_validator("hopping", "lattice_constant")(check_positive_values)
|
159
159
|
|
@@ -172,7 +172,7 @@ class ThreeBandParameters(HamiltonianParameters):
|
|
172
172
|
hubbard_int_orbital_basis: NDArray[Shape["3"], np.float64] = Field(
|
173
173
|
..., description="Hubbard interaction in orbital basis"
|
174
174
|
)
|
175
|
-
delta: NDArray[Shape["3"], np.
|
175
|
+
delta: NDArray[Shape["3"], np.complex128] | None = None
|
176
176
|
|
177
177
|
_check_positive_values = field_validator("hopping", "lattice_constant")(check_positive_values)
|
178
178
|
|
quant_met/parameters/main.py
CHANGED
quant_met/plotting/__init__.py
CHANGED
quant_met/plotting/plotting.py
CHANGED
@@ -36,9 +36,9 @@ def format_plot(
|
|
36
36
|
|
37
37
|
|
38
38
|
def scatter_into_bz(
|
39
|
-
bz_corners: list[npt.NDArray[np.
|
40
|
-
k_points: npt.NDArray[np.
|
41
|
-
data: npt.NDArray[np.
|
39
|
+
bz_corners: list[npt.NDArray[np.floating]],
|
40
|
+
k_points: npt.NDArray[np.floating],
|
41
|
+
data: npt.NDArray[np.floating] | None = None,
|
42
42
|
data_label: str | None = None,
|
43
43
|
fig_in: matplotlib.figure.Figure | None = None,
|
44
44
|
ax_in: matplotlib.axes.Axes | None = None,
|
@@ -89,11 +89,11 @@ def scatter_into_bz(
|
|
89
89
|
|
90
90
|
|
91
91
|
def plot_bandstructure(
|
92
|
-
bands: npt.NDArray[np.
|
93
|
-
k_point_list: npt.NDArray[np.
|
92
|
+
bands: npt.NDArray[np.floating],
|
93
|
+
k_point_list: npt.NDArray[np.floating],
|
94
94
|
ticks: list[float],
|
95
95
|
labels: list[str],
|
96
|
-
overlaps: npt.NDArray[np.
|
96
|
+
overlaps: npt.NDArray[np.floating] | None = None,
|
97
97
|
overlap_labels: list[str] | None = None,
|
98
98
|
fig_in: matplotlib.figure.Figure | None = None,
|
99
99
|
ax_in: matplotlib.axes.Axes | None = None,
|
@@ -167,9 +167,9 @@ def plot_bandstructure(
|
|
167
167
|
|
168
168
|
|
169
169
|
def plot_superfluid_weight(
|
170
|
-
x_data: npt.NDArray[np.
|
171
|
-
sf_weight_geom: npt.NDArray[np.
|
172
|
-
sf_weight_conv: npt.NDArray[np.
|
170
|
+
x_data: npt.NDArray[np.floating],
|
171
|
+
sf_weight_geom: npt.NDArray[np.floating],
|
172
|
+
sf_weight_conv: npt.NDArray[np.floating],
|
173
173
|
fig_in: matplotlib.figure.Figure | None = None,
|
174
174
|
ax_in: matplotlib.axes.Axes | None = None,
|
175
175
|
) -> matplotlib.figure.Figure:
|
quant_met/utils.py
CHANGED
@@ -19,15 +19,16 @@ Functions
|
|
19
19
|
|
20
20
|
import numpy as np
|
21
21
|
import numpy.typing as npt
|
22
|
+
from numba import jit
|
22
23
|
|
23
24
|
|
24
25
|
def generate_uniform_grid(
|
25
26
|
ncols: int,
|
26
27
|
nrows: int,
|
27
|
-
corner_1: npt.NDArray[np.
|
28
|
-
corner_2: npt.NDArray[np.
|
29
|
-
origin: npt.NDArray[np.
|
30
|
-
) -> npt.NDArray[np.
|
28
|
+
corner_1: npt.NDArray[np.floating],
|
29
|
+
corner_2: npt.NDArray[np.floating],
|
30
|
+
origin: npt.NDArray[np.floating],
|
31
|
+
) -> npt.NDArray[np.floating]:
|
31
32
|
"""
|
32
33
|
Generate a uniform grid of points in 2D.
|
33
34
|
|
@@ -57,7 +58,7 @@ def generate_uniform_grid(
|
|
57
58
|
msg = "Vectors to the corners cannot be zero."
|
58
59
|
raise ValueError(msg)
|
59
60
|
|
60
|
-
grid: npt.NDArray[np.
|
61
|
+
grid: npt.NDArray[np.floating] = np.concatenate(
|
61
62
|
[
|
62
63
|
np.linspace(
|
63
64
|
origin[0] + i / (nrows - 1) * corner_2,
|
@@ -69,3 +70,24 @@ def generate_uniform_grid(
|
|
69
70
|
)
|
70
71
|
|
71
72
|
return grid
|
73
|
+
|
74
|
+
|
75
|
+
@jit
|
76
|
+
def fermi_dirac(energy: npt.NDArray[np.floating], beta: float) -> npt.NDArray[np.floating]:
|
77
|
+
"""Fermi dirac distribution.
|
78
|
+
|
79
|
+
Parameters
|
80
|
+
----------
|
81
|
+
energy
|
82
|
+
beta
|
83
|
+
|
84
|
+
Returns
|
85
|
+
-------
|
86
|
+
fermi_dirac
|
87
|
+
|
88
|
+
"""
|
89
|
+
return (
|
90
|
+
np.where(energy < 0, 1.0, 0.0)
|
91
|
+
if np.isinf(beta)
|
92
|
+
else np.asarray(1 / (1 + np.exp(beta * energy)))
|
93
|
+
)
|
@@ -1,24 +1,20 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: quant-met
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.18
|
4
4
|
Summary: Calculate superconductivity in flat-band systems.
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
Requires-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
Requires-Dist:
|
13
|
-
Requires-Dist:
|
14
|
-
Requires-Dist:
|
15
|
-
Requires-Dist:
|
16
|
-
Requires-Dist:
|
17
|
-
Requires-Dist:
|
18
|
-
Requires-Dist: pydantic (>=2.9.2,<3.0.0)
|
19
|
-
Requires-Dist: scipy (>=1.14.1,<2.0.0)
|
20
|
-
Requires-Dist: tables (>=3.10.1,<4.0.0)
|
21
|
-
Project-URL: Repository, https://github.com/Ruberhauptmann/quant-met
|
5
|
+
Author-email: Tjark Sievers <tsievers@physnet.uni-hamburg.de>
|
6
|
+
License-File: LICENSE.txt
|
7
|
+
Requires-Python: >=3.11
|
8
|
+
Requires-Dist: click>=8.1.8
|
9
|
+
Requires-Dist: h5py>=3.12.1
|
10
|
+
Requires-Dist: matplotlib>=3.10.0
|
11
|
+
Requires-Dist: numba>=0.60.0
|
12
|
+
Requires-Dist: numpy<2.1
|
13
|
+
Requires-Dist: numpydantic>=1.6.6
|
14
|
+
Requires-Dist: pandas>=2.2.3
|
15
|
+
Requires-Dist: pydantic>=2.10.4
|
16
|
+
Requires-Dist: scipy>=1.15.0
|
17
|
+
Requires-Dist: tables>=3.10.2
|
22
18
|
Description-Content-Type: text/markdown
|
23
19
|
|
24
20
|
<!--
|
@@ -29,6 +25,7 @@ SPDX-License-Identifier: MIT
|
|
29
25
|
|
30
26
|
# quant-met
|
31
27
|
|
28
|
+
[](https://zenodo.org/badge/latestdoi/800628635)
|
32
29
|
[](https://github.com/Ruberhauptmann/quant-met/actions/workflows/unit_tests.yml)
|
33
30
|
[](https://coveralls.io/github/Ruberhauptmann/quant-met?branch=main)
|
34
31
|
[](https://pypi.org/project/quant-met/)
|
@@ -36,13 +33,14 @@ SPDX-License-Identifier: MIT
|
|
36
33
|
|
37
34
|
quant-met is a python package to treat superconductivity in flat-band systems.
|
38
35
|
|
36
|
+
More information:
|
39
37
|
- Documentation: [quant-met.tjarksievers.de](https://quant-met.tjarksievers.de)
|
40
|
-
-
|
38
|
+
- [User guide](https://quant-met.tjarksievers.de/en/latest/user_guide.html)
|
39
|
+
|
41
40
|
|
42
41
|
## Contributing
|
43
42
|
|
44
43
|
This is a personal project, very geared to the work I did in my master's thesis.
|
45
|
-
If someone is using this and experiencing bugs or want the software extended, feel free to open an issue!
|
46
|
-
|
47
|
-
If you want to contribute, see [documentation](https://quant-met.tjarksievers.de/en/latest/examples.html).
|
44
|
+
If someone is using this and experiencing bugs or want the software extended, feel free to open an [issue](https://github.com/Ruberhauptmann/quant-met/issues/new/choose)!
|
48
45
|
|
46
|
+
If you want to contribute, see [documentation](https://quant-met.tjarksievers.de/en/latest/development.html).
|
@@ -0,0 +1,34 @@
|
|
1
|
+
quant_met/__init__.py,sha256=ZO1UFz1awUYTI7B9ZkBwucvDz7GMGXnLLUGnEwLBhkc,155
|
2
|
+
quant_met/utils.py,sha256=J3kCbKg0tPEoGJExX04QwifHn4ch482J8IcmRQxIfP4,2067
|
3
|
+
quant_met/cli/__init__.py,sha256=nGFXhK8zWyEKQtsQTyJWfEOLFOHTCjZnfEcrVb2dARc,254
|
4
|
+
quant_met/cli/_utils.py,sha256=n_aP8_4sZXgPwBxngDcKozfdgYJL6VTwOn9qFLKrnzY,941
|
5
|
+
quant_met/cli/crit_temp.py,sha256=t9sPZKORl6dpa1UNAOMH2gDmeQxf80iFH7p_L3FI5q8,2027
|
6
|
+
quant_met/cli/main.py,sha256=lVAPGPUZtzyX6QKPEFYyDKFWYhQ30dMXjOEq5VdTa7I,1871
|
7
|
+
quant_met/cli/scf.py,sha256=3_rwtQHwypFjAwjrsO2r2sqjJKpNiDLAj6svU52CCcU,2613
|
8
|
+
quant_met/geometry/__init__.py,sha256=2N8l0-2-PhEOQxaUO7e8Dqy5oaxt2y9343XENDTCGPE,592
|
9
|
+
quant_met/geometry/base_lattice.py,sha256=OJNDMyzJB-0hK1BLgF-SV4jUYfOSUksIv1XG1bH-zyY,2649
|
10
|
+
quant_met/geometry/bz_path.py,sha256=vwN5RxyrgFkHTSqm_6cWuOigICgxa-FX5NZ7SkgKScw,2503
|
11
|
+
quant_met/geometry/graphene.py,sha256=ZLE55wV1E-jRCkGxW66pca2y5VWaNtMmXiXi-HB6bgs,1627
|
12
|
+
quant_met/geometry/square.py,sha256=17XZH79lK9TeeDtXiBBa8rd2d9kv5yt2S9F6te0YZPU,1565
|
13
|
+
quant_met/mean_field/__init__.py,sha256=dO7ATRQyes96tr2WMvmPPqr_S90WL2RCHquRdXWaSjU,662
|
14
|
+
quant_met/mean_field/_utils.py,sha256=7hr0DDSdIqjft5Jjluvbw_HGoNLWgYJTxyuPJJvhBnc,356
|
15
|
+
quant_met/mean_field/quantum_metric.py,sha256=aiZLdUsWmoBLunv-aJr_BCQVfhD7t0GHbeYrT60s3cI,2583
|
16
|
+
quant_met/mean_field/search_crit_temp.py,sha256=Lp6iJEyXnLwfZQ3549J3s9HYQo6OgakzT_FJRRZ5oM0,8661
|
17
|
+
quant_met/mean_field/self_consistency.py,sha256=YY_zhCurxOK3RLkK-Hglfkx33uhsvqpoAKOP4FuPdfo,3371
|
18
|
+
quant_met/mean_field/hamiltonians/__init__.py,sha256=r-8TaLqRnRbAro-TMIyxzCCZHwVqyKrausODpQJb2tw,681
|
19
|
+
quant_met/mean_field/hamiltonians/base_hamiltonian.py,sha256=2UlTckCHyBDujzKQk-GvWXJSqUE_2WEZ9D-m6W0TWuY,26880
|
20
|
+
quant_met/mean_field/hamiltonians/dressed_graphene.py,sha256=Q5LiA3rgK88ZZV1V7JflgjlkEpve7uNZFzFCIoQND-w,4048
|
21
|
+
quant_met/mean_field/hamiltonians/graphene.py,sha256=sa3H8jVq9Fkc_qcz5gJTCMgN8YD3N18JWLRBImhLyxo,3276
|
22
|
+
quant_met/mean_field/hamiltonians/one_band_tight_binding.py,sha256=DZXaD95yWv1VZSMqgxkqEZv3PGihNGy7PuqupnN75ew,2512
|
23
|
+
quant_met/mean_field/hamiltonians/three_band_tight_binding.py,sha256=g8XNImzCn_6CRYKDYI6sy3q6_TBYUDxDmQZ-AqenXTE,3295
|
24
|
+
quant_met/mean_field/hamiltonians/two_band_tight_binding.py,sha256=DMySc94YQ1M2nPIKZjfc-Ax5Ysf7inwSuVKyd6dfqr0,2865
|
25
|
+
quant_met/parameters/__init__.py,sha256=9yu7i0J-O3QxSicnLEh2ci7FSMwB8bPW0pbl8KWHJUs,1007
|
26
|
+
quant_met/parameters/hamiltonians.py,sha256=PiWVV-miCdT4Z9GWloDVvIU_1QpRHHV-zVOga7DWwCw,6046
|
27
|
+
quant_met/parameters/main.py,sha256=bHf3Ixjg7nkr_kDihZUXC1egmXo7LecxmVsqBS-eOAA,2165
|
28
|
+
quant_met/plotting/__init__.py,sha256=VypHrLAGmCiQaQggGh5Cs4EF4YAjRiETddf_7mOX9MQ,544
|
29
|
+
quant_met/plotting/plotting.py,sha256=4ZYclWJH3hlE8S7b7bL_JJlP3CKaCGcVzdIsqolCAaM,6592
|
30
|
+
quant_met-0.0.18.dist-info/METADATA,sha256=t4UafmOjpoGKF8s6dqo3J_kKQA2kZhtSZiZaNaFAgHs,1949
|
31
|
+
quant_met-0.0.18.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
32
|
+
quant_met-0.0.18.dist-info/entry_points.txt,sha256=1Al3Kt-cMeQxwMp84ZSNL0qFwlbOVBu1o8A19MH8lEU,48
|
33
|
+
quant_met-0.0.18.dist-info/licenses/LICENSE.txt,sha256=QO_duPQihSJlaxSLxPAXo52X3esROP5wBkhxqBd1Z4E,1104
|
34
|
+
quant_met-0.0.18.dist-info/RECORD,,
|
@@ -1,123 +0,0 @@
|
|
1
|
-
# SPDX-FileCopyrightText: 2024 Tjark Sievers
|
2
|
-
#
|
3
|
-
# SPDX-License-Identifier: MIT
|
4
|
-
|
5
|
-
"""Functions to calculate the superfluid weight."""
|
6
|
-
|
7
|
-
import numpy as np
|
8
|
-
import numpy.typing as npt
|
9
|
-
|
10
|
-
from quant_met.mean_field.hamiltonians.base_hamiltonian import BaseHamiltonian
|
11
|
-
from quant_met.parameters import GenericParameters
|
12
|
-
|
13
|
-
|
14
|
-
def superfluid_weight(
|
15
|
-
h: BaseHamiltonian[GenericParameters],
|
16
|
-
k: npt.NDArray[np.float64],
|
17
|
-
) -> tuple[npt.NDArray[np.complex64], npt.NDArray[np.complex64]]:
|
18
|
-
"""Calculate the superfluid weight.
|
19
|
-
|
20
|
-
Parameters
|
21
|
-
----------
|
22
|
-
h : :class:`~quant_met.mean_field.Hamiltonian`
|
23
|
-
Hamiltonian.
|
24
|
-
k : :class:`numpy.ndarray`
|
25
|
-
List of k points.
|
26
|
-
|
27
|
-
Returns
|
28
|
-
-------
|
29
|
-
:class:`numpy.ndarray`
|
30
|
-
Conventional contribution to the superfluid weight.
|
31
|
-
:class:`numpy.ndarray`
|
32
|
-
Geometric contribution to the superfluid weight.
|
33
|
-
|
34
|
-
"""
|
35
|
-
s_weight_conv = np.zeros(shape=(2, 2), dtype=np.complex64)
|
36
|
-
s_weight_geom = np.zeros(shape=(2, 2), dtype=np.complex64)
|
37
|
-
|
38
|
-
for i, direction_1 in enumerate(["x", "y"]):
|
39
|
-
for j, direction_2 in enumerate(["x", "y"]):
|
40
|
-
for k_point in k:
|
41
|
-
c_mnpq = _c_factor(h, k_point)
|
42
|
-
j_up = _current_operator(h, direction_1, k_point)
|
43
|
-
j_down = _current_operator(h, direction_2, -k_point)
|
44
|
-
for m in range(h.number_of_bands):
|
45
|
-
for n in range(h.number_of_bands):
|
46
|
-
for p in range(h.number_of_bands):
|
47
|
-
for q in range(h.number_of_bands):
|
48
|
-
s_weight = c_mnpq[m, n, p, q] * j_up[m, n] * j_down[q, p]
|
49
|
-
if m == n and p == q:
|
50
|
-
s_weight_conv[i, j] += s_weight
|
51
|
-
else:
|
52
|
-
s_weight_geom[i, j] += s_weight
|
53
|
-
|
54
|
-
return s_weight_conv, s_weight_geom
|
55
|
-
|
56
|
-
|
57
|
-
def _current_operator(
|
58
|
-
h: BaseHamiltonian[GenericParameters], direction: str, k: npt.NDArray[np.float64]
|
59
|
-
) -> npt.NDArray[np.complex64]:
|
60
|
-
j = np.zeros(shape=(h.number_of_bands, h.number_of_bands), dtype=np.complex64)
|
61
|
-
|
62
|
-
_, bloch = h.diagonalize_nonint(k=k)
|
63
|
-
|
64
|
-
for m in range(h.number_of_bands):
|
65
|
-
for n in range(h.number_of_bands):
|
66
|
-
j[m, n] = (
|
67
|
-
bloch[:, m].conjugate()
|
68
|
-
@ h.hamiltonian_derivative(direction=direction, k=k)
|
69
|
-
@ bloch[:, n]
|
70
|
-
)
|
71
|
-
|
72
|
-
return j
|
73
|
-
|
74
|
-
|
75
|
-
def _c_factor(
|
76
|
-
h: BaseHamiltonian[GenericParameters], k: npt.NDArray[np.float64]
|
77
|
-
) -> npt.NDArray[np.complex64]:
|
78
|
-
bdg_energies, bdg_functions = h.diagonalize_bdg(k)
|
79
|
-
c_mnpq = np.zeros(
|
80
|
-
shape=(
|
81
|
-
h.number_of_bands,
|
82
|
-
h.number_of_bands,
|
83
|
-
h.number_of_bands,
|
84
|
-
h.number_of_bands,
|
85
|
-
),
|
86
|
-
dtype=np.complex64,
|
87
|
-
)
|
88
|
-
|
89
|
-
for m in range(h.number_of_bands):
|
90
|
-
for n in range(h.number_of_bands):
|
91
|
-
for p in range(h.number_of_bands):
|
92
|
-
for q in range(h.number_of_bands):
|
93
|
-
c_tmp: float = 0
|
94
|
-
for i in range(2 * h.number_of_bands):
|
95
|
-
for j in range(2 * h.number_of_bands):
|
96
|
-
if bdg_energies[i] != bdg_energies[j]:
|
97
|
-
c_tmp += (
|
98
|
-
_fermi_dirac(bdg_energies[i]) - _fermi_dirac(bdg_energies[j])
|
99
|
-
) / (bdg_energies[j] - bdg_energies[i])
|
100
|
-
else:
|
101
|
-
c_tmp -= _fermi_dirac_derivative()
|
102
|
-
|
103
|
-
c_tmp *= (
|
104
|
-
bdg_functions[i, m].conjugate()
|
105
|
-
* bdg_functions[j, n]
|
106
|
-
* bdg_functions[j, p].conjugate()
|
107
|
-
* bdg_functions[i, q].conjugate()
|
108
|
-
)
|
109
|
-
|
110
|
-
c_mnpq[m, n, p, q] = 2 * c_tmp
|
111
|
-
|
112
|
-
return c_mnpq
|
113
|
-
|
114
|
-
|
115
|
-
def _fermi_dirac_derivative() -> float:
|
116
|
-
return 0
|
117
|
-
|
118
|
-
|
119
|
-
def _fermi_dirac(energy: np.float64) -> np.float64:
|
120
|
-
if energy > 0:
|
121
|
-
return np.float64(0)
|
122
|
-
|
123
|
-
return np.float64(1)
|
@@ -1,9 +0,0 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2024-present Tjark <tsievers@physnet.uni-hamburg.de>
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6
|
-
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
8
|
-
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|