quant-met 0.0.2__py3-none-any.whl → 0.0.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.
@@ -0,0 +1,17 @@
1
+ quant_met/__init__.py,sha256=ZO1UFz1awUYTI7B9ZkBwucvDz7GMGXnLLUGnEwLBhkc,155
2
+ quant_met/mean_field/__init__.py,sha256=kBkGItunNits1SrSMRIfKkqeSXvzbUJQS-OkcV-0zmc,1136
3
+ quant_met/mean_field/_utils.py,sha256=plkx6eYjyYV3CT3BWwlulqW7L-Q0t1TzZTLR4k7u0dg,666
4
+ quant_met/mean_field/base_hamiltonian.py,sha256=YvuUD_RxZVS7yWIJrkylbaOieslz86zrQa7gRWM-6ow,8505
5
+ quant_met/mean_field/eg_x.py,sha256=hv4gTOnqfLAi_OR3uSZlzph-vrRqnhnCqz3_qJzY8nw,4003
6
+ quant_met/mean_field/free_energy.py,sha256=FSGCHoBO1myHGwGQ8CqGu7_08whH0Ot3ikZhBu27tyM,3444
7
+ quant_met/mean_field/graphene.py,sha256=lR_T7TdJiBA_8leG6aUQ4hllxKnjI5qsLVCUUKU-jpw,3025
8
+ quant_met/mean_field/quantum_metric.py,sha256=ohTs1IzReXFMj03QOKlvlenM94VJjmyAyd4KicHL5gI,2002
9
+ quant_met/mean_field/superfluid_weight.py,sha256=egW9f3zR_NC5hLTNOdw_GA3fsKOE-L45LDSze2eGcoY,4899
10
+ quant_met/plotting/__init__.py,sha256=QRQ3TNb0PNQi2lWXY0LHKgYSRuegM1N3dVVs9146Zug,457
11
+ quant_met/plotting/plotting.py,sha256=iVTFZ9tQz_GalzqbQhxCiNWOhYHJM4wiZPTjXaXnApM,7326
12
+ quant_met/utils.py,sha256=Tvw_YfqjIWx0FPGSReikSnw9xfN-T2dpQZN-KPMa69A,1709
13
+ quant_met-0.0.3.dist-info/LICENSE.txt,sha256=QO_duPQihSJlaxSLxPAXo52X3esROP5wBkhxqBd1Z4E,1104
14
+ quant_met-0.0.3.dist-info/LICENSES/MIT.txt,sha256=QO_duPQihSJlaxSLxPAXo52X3esROP5wBkhxqBd1Z4E,1104
15
+ quant_met-0.0.3.dist-info/METADATA,sha256=dB9mP1Ytt6ptRbse_R2-8TcNKFWzUJVe0tMsqIQPReI,2598
16
+ quant_met-0.0.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
17
+ quant_met-0.0.3.dist-info/RECORD,,
@@ -1,14 +0,0 @@
1
- from ._base_hamiltonian import BaseHamiltonian
2
- from ._eg_x import EGXHamiltonian
3
- from ._free_energy import free_energy, free_energy_uniform_pairing
4
- from ._graphene import GrapheneHamiltonian
5
- from ._superfluid_weight import calculate_superfluid_weight
6
-
7
- __all__ = [
8
- "BaseHamiltonian",
9
- "GrapheneHamiltonian",
10
- "EGXHamiltonian",
11
- "calculate_superfluid_weight",
12
- "free_energy",
13
- "free_energy_uniform_pairing",
14
- ]
@@ -1,124 +0,0 @@
1
- import numpy as np
2
- import numpy.typing as npt
3
-
4
- from ._base_hamiltonian import BaseHamiltonian
5
- from ._utils import _check_valid_float
6
-
7
-
8
- class EGXHamiltonian(BaseHamiltonian):
9
- def __init__(
10
- self,
11
- t_gr: float,
12
- t_x: float,
13
- V: float,
14
- a: float,
15
- mu: float,
16
- U_gr: float,
17
- U_x: float,
18
- delta: npt.NDArray[np.float64] | None = None,
19
- ):
20
- self.t_gr = _check_valid_float(t_gr, "Hopping graphene")
21
- self.t_x = _check_valid_float(t_x, "Hopping impurity")
22
- self.V = _check_valid_float(V, "Hybridisation")
23
- self.a = _check_valid_float(a, "Lattice constant")
24
- self.mu = _check_valid_float(mu, "Chemical potential")
25
- self.U_gr = _check_valid_float(U_gr, "Coloumb interaction graphene")
26
- self.U_x = _check_valid_float(U_x, "Coloumb interaction impurity")
27
- if delta is None:
28
- self._delta_orbital_basis = np.zeros(3)
29
- else:
30
- self._delta_orbital_basis = delta
31
-
32
- @property
33
- def coloumb_orbital_basis(self) -> npt.NDArray[np.float64]:
34
- return np.array([self.U_gr, self.U_gr, self.U_x])
35
-
36
- @property
37
- def delta_orbital_basis(self) -> npt.NDArray[np.float64]:
38
- return self._delta_orbital_basis
39
-
40
- @delta_orbital_basis.setter
41
- def delta_orbital_basis(self, new_delta: npt.NDArray[np.float64]) -> None:
42
- self._delta_orbital_basis = new_delta
43
-
44
- @property
45
- def number_of_bands(self) -> int:
46
- return 3
47
-
48
- def _hamiltonian_derivative_one_point(
49
- self, k: npt.NDArray[np.float64], direction: str
50
- ) -> npt.NDArray[np.complex64]:
51
- assert direction in ["x", "y"]
52
-
53
- t_gr = self.t_gr
54
- t_x = self.t_x
55
- a = self.a
56
-
57
- h = np.zeros((self.number_of_bands, self.number_of_bands), dtype=np.complex64)
58
-
59
- if direction == "x":
60
- h[0, 1] = (
61
- t_gr
62
- * a
63
- * np.exp(-0.5j * a / np.sqrt(3) * k[1])
64
- * np.sin(0.5 * a * k[0])
65
- )
66
- h[1, 0] = h[0, 1].conjugate()
67
- h[2, 2] = (
68
- 2
69
- * a
70
- * t_x
71
- * (
72
- np.sin(a * k[0])
73
- + np.sin(0.5 * a * k[0]) * np.cos(0.5 * np.sqrt(3) * a * k[1])
74
- )
75
- )
76
- else:
77
- h[0, 1] = (
78
- -t_gr
79
- * 1j
80
- * a
81
- / np.sqrt(3)
82
- * (
83
- np.exp(1j * a / np.sqrt(3) * k[1])
84
- - np.exp(-0.5j * a / np.sqrt(3) * k[1]) * np.cos(0.5 * a * k[0])
85
- )
86
- )
87
- h[1, 0] = h[0, 1].conjugate()
88
- h[2, 2] = np.sqrt(3) * a * t_x * np.cos(0.5 * np.sqrt(3) * a * k[1])
89
-
90
- return h
91
-
92
- def _hamiltonian_one_point(
93
- self, k: npt.NDArray[np.float64]
94
- ) -> npt.NDArray[np.complex64]:
95
- t_gr = self.t_gr
96
- t_x = self.t_x
97
- a = self.a
98
- # a_0 = a / np.sqrt(3)
99
- V = self.V
100
- mu = self.mu
101
-
102
- h = np.zeros((self.number_of_bands, self.number_of_bands), dtype=np.complex64)
103
-
104
- h[0, 1] = -t_gr * (
105
- np.exp(1j * k[1] * a / np.sqrt(3))
106
- + 2 * np.exp(-0.5j * a / np.sqrt(3) * k[1]) * (np.cos(0.5 * a * k[0]))
107
- )
108
-
109
- h[1, 0] = h[0, 1].conjugate()
110
-
111
- h[2, 0] = V
112
- h[0, 2] = V
113
-
114
- h[2, 2] = (
115
- -2
116
- * t_x
117
- * (
118
- np.cos(a * k[0])
119
- + 2 * np.cos(0.5 * a * k[0]) * np.cos(0.5 * np.sqrt(3) * a * k[1])
120
- )
121
- )
122
- h -= mu * np.eye(3, dtype=np.complex64)
123
-
124
- return h
@@ -1,39 +0,0 @@
1
- import numpy as np
2
- import numpy.typing as npt
3
-
4
- from ._base_hamiltonian import BaseHamiltonian
5
-
6
-
7
- def free_energy(
8
- delta_vector: npt.NDArray[np.float64],
9
- hamiltonian: BaseHamiltonian,
10
- k_points: npt.NDArray[np.float64],
11
- ) -> float:
12
- number_k_points = len(k_points)
13
- hamiltonian.delta_orbital_basis = delta_vector
14
- bdg_energies, _ = hamiltonian.diagonalize_bdg(k_points)
15
-
16
- k_array = np.array(
17
- [
18
- np.sum(np.abs(bdg_energies[k_index][0 : hamiltonian.number_of_bands]))
19
- for k_index in range(number_k_points)
20
- ]
21
- )
22
-
23
- integral: float = -np.sum(k_array, axis=-1) / number_k_points + np.sum(
24
- np.power(np.abs(delta_vector), 2) / hamiltonian.coloumb_orbital_basis
25
- )
26
-
27
- return integral
28
-
29
-
30
- def free_energy_uniform_pairing(
31
- delta: float,
32
- hamiltonian: BaseHamiltonian,
33
- k_points: npt.NDArray[np.float64],
34
- ) -> float:
35
- delta_vector = np.ones(hamiltonian.number_of_bands) * delta
36
-
37
- return free_energy(
38
- delta_vector=delta_vector, hamiltonian=hamiltonian, k_points=k_points
39
- )
@@ -1,10 +0,0 @@
1
- import numpy as np
2
-
3
-
4
- def _check_valid_float(float_in: float, parameter_name: str) -> float:
5
- if np.isinf(float_in):
6
- raise ValueError(f"{parameter_name} must not be Infinity")
7
- elif np.isnan(float_in):
8
- raise ValueError(f"{parameter_name} must not be NaN")
9
- else:
10
- return float_in
@@ -1,156 +0,0 @@
1
- from typing import Any, List, Tuple
2
-
3
- import matplotlib.axes
4
- import matplotlib.colors
5
- import matplotlib.figure
6
- import matplotlib.pyplot as plt
7
- import numpy as np
8
- import numpy.typing as npt
9
- from matplotlib.collections import LineCollection
10
- from numpy import dtype, generic, ndarray
11
-
12
-
13
- def scatter_into_bz(
14
- bz_corners: List[npt.NDArray[np.float64]],
15
- k_points: npt.NDArray[np.float64],
16
- data: npt.NDArray[np.float64] | None = None,
17
- data_label: str | None = None,
18
- fig_in: matplotlib.figure.Figure | None = None,
19
- ax_in: matplotlib.axes.Axes | None = None,
20
- ) -> matplotlib.figure.Figure:
21
- if fig_in is None or ax_in is None:
22
- fig, ax = plt.subplots()
23
- else:
24
- fig, ax = fig_in, ax_in
25
-
26
- if data is not None:
27
- scatter = ax.scatter(*zip(*k_points), c=data, cmap="viridis")
28
- fig.colorbar(scatter, ax=ax, fraction=0.046, pad=0.04, label=data_label)
29
- else:
30
- ax.scatter(*zip(*k_points))
31
-
32
- ax.scatter(*zip(*bz_corners), alpha=0.8)
33
- ax.set_aspect("equal", adjustable="box")
34
- ax.set_xlabel(r"$k_x\ [1/a_0]$")
35
- ax.set_ylabel(r"$k_y\ [1/a_0]$")
36
-
37
- return fig
38
-
39
-
40
- def plot_bandstructure(
41
- bands: npt.NDArray[np.float64],
42
- k_point_list: npt.NDArray[np.float64],
43
- ticks: List[float],
44
- labels: List[str],
45
- overlaps: npt.NDArray[np.float64] | None = None,
46
- overlap_labels: List[str] | None = None,
47
- fig_in: matplotlib.figure.Figure | None = None,
48
- ax_in: matplotlib.axes.Axes | None = None,
49
- ) -> matplotlib.figure.Figure:
50
- if fig_in is None or ax_in is None:
51
- fig, ax = plt.subplots()
52
- else:
53
- fig, ax = fig_in, ax_in
54
-
55
- ax.axhline(y=0, alpha=0.7, linestyle="--", color="black")
56
-
57
- if overlaps is None:
58
- for band in bands:
59
- ax.plot(k_point_list, band)
60
- else:
61
- line = LineCollection(segments=[np.array([(0, 0)])])
62
- for band, wx in zip(bands, overlaps):
63
- points = np.array([k_point_list, band]).T.reshape(-1, 1, 2)
64
- segments = np.concatenate([points[:-1], points[1:]], axis=1)
65
-
66
- norm = matplotlib.colors.Normalize(-1, 1)
67
- lc = LineCollection(segments, cmap="seismic", norm=norm)
68
- lc.set_array(wx)
69
- lc.set_linewidth(2)
70
- line = ax.add_collection(lc)
71
-
72
- colorbar = fig.colorbar(line, fraction=0.046, pad=0.04, ax=ax)
73
- color_ticks = [-1, 1]
74
- colorbar.set_ticks(ticks=color_ticks, labels=overlap_labels)
75
-
76
- ax.set_ylim(
77
- top=np.max(bands) + 0.1 * np.max(bands),
78
- bottom=np.min(bands) - 0.1 * np.abs(np.min(bands)),
79
- )
80
- ax.set_box_aspect(1)
81
- ax.set_xticks(ticks, labels)
82
- ax.set_ylabel(r"$E\ [t]$")
83
- ax.set_facecolor("lightgray")
84
- ax.grid(visible=True)
85
- ax.tick_params(
86
- axis="both", direction="in", bottom=True, top=True, left=True, right=True
87
- )
88
-
89
- return fig
90
-
91
-
92
- def _generate_part_of_path(
93
- p_0: npt.NDArray[np.float64],
94
- p_1: npt.NDArray[np.float64],
95
- n: int,
96
- length_whole_path: int,
97
- ) -> npt.NDArray[np.float64]:
98
- distance = np.linalg.norm(p_1 - p_0)
99
- number_of_points = int(n * distance / length_whole_path) + 1
100
-
101
- k_space_path = np.vstack(
102
- [
103
- np.linspace(p_0[0], p_1[0], number_of_points),
104
- np.linspace(p_0[1], p_1[1], number_of_points),
105
- ]
106
- ).T[:-1]
107
-
108
- return k_space_path
109
-
110
-
111
- def generate_bz_path(
112
- points: List[Tuple[npt.NDArray[np.float64], str]], number_of_points: int = 1000
113
- ) -> tuple[
114
- ndarray[Any, dtype[generic | generic | Any]],
115
- ndarray[Any, dtype[generic | generic | Any]],
116
- list[int | Any],
117
- list[str],
118
- ]:
119
- n = number_of_points
120
-
121
- cycle = [
122
- np.linalg.norm(points[i][0] - points[i + 1][0]) for i in range(len(points) - 1)
123
- ]
124
- cycle.append(np.linalg.norm(points[-1][0] - points[0][0]))
125
-
126
- length_whole_path = np.sum(np.array([cycle]))
127
-
128
- ticks = [0]
129
- for i in range(0, len(cycle) - 1):
130
- ticks.append(np.sum(cycle[0 : i + 1]) / length_whole_path)
131
- ticks.append(1)
132
- labels = [rf"${points[i][1]}$" for i in range(len(points))]
133
- labels.append(rf"${points[0][1]}$")
134
-
135
- whole_path_plot = np.concatenate(
136
- [
137
- np.linspace(
138
- ticks[i],
139
- ticks[i + 1],
140
- num=int(n * cycle[i] / length_whole_path),
141
- endpoint=False,
142
- )
143
- for i in range(0, len(ticks) - 1)
144
- ]
145
- )
146
-
147
- points_path = [
148
- _generate_part_of_path(points[i][0], points[i + 1][0], n, length_whole_path)
149
- for i in range(0, len(points) - 1)
150
- ]
151
- points_path.append(
152
- _generate_part_of_path(points[-1][0], points[0][0], n, length_whole_path)
153
- )
154
- whole_path = np.concatenate(points_path)
155
-
156
- return whole_path, whole_path_plot, ticks, labels
@@ -1,15 +0,0 @@
1
- quant_met/__init__.py,sha256=Exc923N_e87XwJA_lO22UiG4WQy7dnmPmnuLiHyamRk,149
2
- quant_met/hamiltonians/__init__.py,sha256=PahN7ppBysli0rKnPLhTBMVaKC_nlD2mJfTvzfrrrRs,427
3
- quant_met/hamiltonians/_base_hamiltonian.py,sha256=N-8Pik-TByDFeaHUH_X442A6mBOaQWlRcN8UdywfFzE,5857
4
- quant_met/hamiltonians/_eg_x.py,sha256=QmVdrO26qMPp2AQA3ClHb1cBGHAx2BVjfF22WcpZMHw,3643
5
- quant_met/hamiltonians/_free_energy.py,sha256=Y7OFL-PFTZsrC4tLY5jegwVhnUeaQwLFE1w_8U9hoPs,1065
6
- quant_met/hamiltonians/_graphene.py,sha256=p8bRCcNsKguz2B3hbbtp-wGGAQtj6MDIZSwIQoY7Yug,2778
7
- quant_met/hamiltonians/_superfluid_weight.py,sha256=_YUJ5yE1x4JswuY8gydo5iN7LS0mP2Aeikhhsjy7CeQ,4260
8
- quant_met/hamiltonians/_utils.py,sha256=w2fMk6APN7kmSF6x4mVk-8CWKul-Ut01oBzQK0V6DbA,311
9
- quant_met/plotting/__init__.py,sha256=b-r6EpFZdc0aX0OrN_SXTo84ojjV8P_htlnnsmVkQWI,165
10
- quant_met/plotting/_plotting.py,sha256=YfJB6G4E_htnpBh-eogs1ieKNIXK7Hw0S4_qX9mGmj4,4737
11
- quant_met/utils.py,sha256=wLW7Q-_RbcKBdxCOJqIW_5BDuReE6leRtagABJvlm6U,821
12
- quant_met-0.0.2.dist-info/LICENSE.txt,sha256=QO_duPQihSJlaxSLxPAXo52X3esROP5wBkhxqBd1Z4E,1104
13
- quant_met-0.0.2.dist-info/METADATA,sha256=c_Y95udJ7geJwTpY4Yb4FCwOs2mb718nzlut_5YAmnM,2602
14
- quant_met-0.0.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
15
- quant_met-0.0.2.dist-info/RECORD,,