quant-met 0.0.27__py3-none-any.whl → 0.1.1__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.
Files changed (47) hide show
  1. quant_met/__init__.py +2 -7
  2. quant_met/bdg/__init__.py +26 -0
  3. quant_met/bdg/bdg_hamiltonian.py +97 -0
  4. quant_met/bdg/gap_equation.py +127 -0
  5. quant_met/bdg/sc_current.py +60 -0
  6. quant_met/bdg/superfluid_weight.py +110 -0
  7. quant_met/cli/__init__.py +0 -5
  8. quant_met/cli/crit_temp.py +18 -16
  9. quant_met/cli/main.py +8 -5
  10. quant_met/cli/q_analysis.py +60 -0
  11. quant_met/cli/q_loop.py +95 -0
  12. quant_met/cli/scf.py +44 -23
  13. quant_met/parameters/__init__.py +0 -26
  14. quant_met/parameters/control.py +57 -0
  15. quant_met/parameters/main.py +2 -55
  16. quant_met/quantum_geometry/__init__.py +13 -0
  17. quant_met/quantum_geometry/qgt.py +37 -0
  18. quant_met/routines/__init__.py +22 -0
  19. quant_met/routines/analyse_q_data.py +226 -0
  20. quant_met/routines/loop_over_q.py +154 -0
  21. quant_met/{mean_field → routines}/search_crit_temp.py +71 -48
  22. quant_met/{mean_field → routines}/self_consistency.py +32 -28
  23. quant_met/utils.py +1 -6
  24. {quant_met-0.0.27.dist-info → quant_met-0.1.1.dist-info}/METADATA +5 -11
  25. quant_met-0.1.1.dist-info/RECORD +28 -0
  26. quant_met/cli/_utils.py +0 -32
  27. quant_met/geometry/__init__.py +0 -36
  28. quant_met/geometry/base_lattice.py +0 -100
  29. quant_met/geometry/bz_path.py +0 -90
  30. quant_met/geometry/graphene.py +0 -48
  31. quant_met/geometry/square.py +0 -47
  32. quant_met/mean_field/__init__.py +0 -38
  33. quant_met/mean_field/_utils.py +0 -17
  34. quant_met/mean_field/hamiltonians/__init__.py +0 -34
  35. quant_met/mean_field/hamiltonians/base_hamiltonian.py +0 -793
  36. quant_met/mean_field/hamiltonians/dressed_graphene.py +0 -118
  37. quant_met/mean_field/hamiltonians/graphene.py +0 -95
  38. quant_met/mean_field/hamiltonians/one_band_tight_binding.py +0 -70
  39. quant_met/mean_field/hamiltonians/three_band_tight_binding.py +0 -85
  40. quant_met/mean_field/hamiltonians/two_band_tight_binding.py +0 -76
  41. quant_met/parameters/hamiltonians.py +0 -182
  42. quant_met/plotting/__init__.py +0 -31
  43. quant_met/plotting/plotting.py +0 -215
  44. quant_met-0.0.27.dist-info/RECORD +0 -33
  45. {quant_met-0.0.27.dist-info → quant_met-0.1.1.dist-info}/WHEEL +0 -0
  46. {quant_met-0.0.27.dist-info → quant_met-0.1.1.dist-info}/entry_points.txt +0 -0
  47. {quant_met-0.0.27.dist-info → quant_met-0.1.1.dist-info}/licenses/LICENSE.txt +0 -0
@@ -1,118 +0,0 @@
1
- # SPDX-FileCopyrightText: 2024 Tjark Sievers
2
- # SPDX-FileCopyrightText: 2025 Tjark Sievers
3
- #
4
- # SPDX-License-Identifier: MIT
5
-
6
- """Provides the implementation for the dressed graphene model."""
7
-
8
- import numpy as np
9
- import numpy.typing as npt
10
-
11
- from quant_met.geometry import BaseLattice
12
- from quant_met.geometry.graphene import GrapheneLattice
13
- from quant_met.mean_field._utils import _check_valid_array
14
- from quant_met.parameters.hamiltonians import DressedGrapheneParameters
15
-
16
- from .base_hamiltonian import BaseHamiltonian
17
-
18
-
19
- class DressedGraphene(BaseHamiltonian[DressedGrapheneParameters]):
20
- """Hamiltonian for the dressed graphene model."""
21
-
22
- def __init__(self, parameters: DressedGrapheneParameters) -> None:
23
- super().__init__(parameters)
24
- self.hopping_gr = parameters.hopping_gr
25
- self.hopping_x = parameters.hopping_x
26
- self.hopping_x_gr_a = parameters.hopping_x_gr_a
27
- self.hubbard_int_orbital_basis = parameters.hubbard_int_orbital_basis
28
- self.chemical_potential = parameters.chemical_potential
29
- if parameters.delta is not None:
30
- self.delta_orbital_basis = parameters.delta.astype(np.complex128)
31
-
32
- def setup_lattice(self, parameters: DressedGrapheneParameters) -> BaseLattice: # noqa: D102
33
- return GrapheneLattice(lattice_constant=parameters.lattice_constant)
34
-
35
- @classmethod
36
- def get_parameters_model(cls) -> type[DressedGrapheneParameters]: # noqa: D102
37
- return DressedGrapheneParameters
38
-
39
- def hamiltonian(self, k: npt.NDArray[np.floating]) -> npt.NDArray[np.complexfloating]: # noqa: D102
40
- assert _check_valid_array(k)
41
-
42
- t_gr = self.hopping_gr
43
- t_x = self.hopping_x
44
- a = self.lattice.lattice_constant
45
- v = self.hopping_x_gr_a
46
- chemical_potential = self.chemical_potential
47
- if k.ndim == 1:
48
- k = np.expand_dims(k, axis=0)
49
-
50
- h = np.zeros((k.shape[0], self.number_of_bands, self.number_of_bands), dtype=np.complex128)
51
-
52
- h[:, 0, 1] = -t_gr * (
53
- np.exp(1j * k[:, 1] * a / np.sqrt(3))
54
- + 2 * np.exp(-0.5j * a / np.sqrt(3) * k[:, 1]) * (np.cos(0.5 * a * k[:, 0]))
55
- )
56
-
57
- h[:, 1, 0] = h[:, 0, 1].conjugate()
58
-
59
- h[:, 2, 0] = v
60
- h[:, 0, 2] = v
61
-
62
- h[:, 2, 2] = (
63
- -2
64
- * t_x
65
- * (
66
- np.cos(a * k[:, 0])
67
- + 2 * np.cos(0.5 * a * k[:, 0]) * np.cos(0.5 * np.sqrt(3) * a * k[:, 1])
68
- )
69
- )
70
- h[:, 0, 0] -= chemical_potential
71
- h[:, 1, 1] -= chemical_potential
72
- h[:, 2, 2] -= chemical_potential
73
-
74
- return h.squeeze()
75
-
76
- def hamiltonian_derivative( # noqa: D102
77
- self, k: npt.NDArray[np.floating], direction: str
78
- ) -> npt.NDArray[np.complexfloating]:
79
- assert _check_valid_array(k)
80
- assert direction in ["x", "y"]
81
-
82
- t_gr = self.hopping_gr
83
- t_x = self.hopping_x
84
- a = self.lattice.lattice_constant
85
- if k.ndim == 1:
86
- k = np.expand_dims(k, axis=0)
87
-
88
- h = np.zeros((k.shape[0], self.number_of_bands, self.number_of_bands), dtype=np.complex128)
89
-
90
- if direction == "x":
91
- h[:, 0, 1] = (
92
- t_gr * a * np.exp(-0.5j * a / np.sqrt(3) * k[:, 1]) * np.sin(0.5 * a * k[:, 0])
93
- )
94
- h[:, 1, 0] = h[:, 0, 1].conjugate()
95
- h[:, 2, 2] = (
96
- 2
97
- * a
98
- * t_x
99
- * (
100
- np.sin(a * k[:, 0])
101
- + np.sin(0.5 * a * k[:, 0]) * np.cos(0.5 * np.sqrt(3) * a * k[:, 1])
102
- )
103
- )
104
- else:
105
- h[:, 0, 1] = (
106
- -t_gr
107
- * 1j
108
- * a
109
- / np.sqrt(3)
110
- * (
111
- np.exp(1j * a / np.sqrt(3) * k[:, 1])
112
- - np.exp(-0.5j * a / np.sqrt(3) * k[:, 1]) * np.cos(0.5 * a * k[:, 0])
113
- )
114
- )
115
- h[:, 1, 0] = h[:, 0, 1].conjugate()
116
- h[:, 2, 2] = np.sqrt(3) * a * t_x * np.cos(0.5 * np.sqrt(3) * a * k[:, 1])
117
-
118
- return h.squeeze()
@@ -1,95 +0,0 @@
1
- # SPDX-FileCopyrightText: 2024 Tjark Sievers
2
- # SPDX-FileCopyrightText: 2025 Tjark Sievers
3
- #
4
- # SPDX-License-Identifier: MIT
5
-
6
- """Provides the implementation for Graphene."""
7
-
8
- import numpy as np
9
- import numpy.typing as npt
10
-
11
- from quant_met.geometry import GrapheneLattice
12
- from quant_met.mean_field._utils import _check_valid_array
13
- from quant_met.parameters.hamiltonians import GrapheneParameters
14
-
15
- from .base_hamiltonian import BaseHamiltonian
16
-
17
-
18
- class Graphene(BaseHamiltonian[GrapheneParameters]):
19
- """Hamiltonian for Graphene."""
20
-
21
- def __init__(
22
- self,
23
- parameters: GrapheneParameters,
24
- ) -> None:
25
- super().__init__(parameters)
26
- self.hopping = parameters.hopping
27
- self.chemical_potential = parameters.chemical_potential
28
- if parameters.delta is not None:
29
- self.delta_orbital_basis = parameters.delta.astype(np.complex128)
30
-
31
- def setup_lattice(self, parameters: GrapheneParameters) -> GrapheneLattice: # noqa: D102
32
- return GrapheneLattice(lattice_constant=parameters.lattice_constant)
33
-
34
- @classmethod
35
- def get_parameters_model(cls) -> type[GrapheneParameters]: # noqa: D102
36
- return GrapheneParameters
37
-
38
- def hamiltonian(self, k: npt.NDArray[np.floating]) -> npt.NDArray[np.complexfloating]: # noqa: D102
39
- assert _check_valid_array(k)
40
- hopping = self.hopping
41
- lattice_constant = self.lattice.lattice_constant
42
- chemical_potential = self.chemical_potential
43
- if k.ndim == 1:
44
- k = np.expand_dims(k, axis=0)
45
-
46
- h = np.zeros((k.shape[0], self.number_of_bands, self.number_of_bands), dtype=np.complex128)
47
-
48
- h[:, 0, 1] = -hopping * (
49
- np.exp(1j * k[:, 1] * lattice_constant / np.sqrt(3))
50
- + 2
51
- * np.exp(-0.5j * lattice_constant / np.sqrt(3) * k[:, 1])
52
- * (np.cos(0.5 * lattice_constant * k[:, 0]))
53
- )
54
- h[:, 1, 0] = h[:, 0, 1].conjugate()
55
- h[:, 0, 0] -= chemical_potential
56
- h[:, 1, 1] -= chemical_potential
57
-
58
- return h.squeeze()
59
-
60
- def hamiltonian_derivative( # noqa: D102
61
- self, k: npt.NDArray[np.floating], direction: str
62
- ) -> npt.NDArray[np.complexfloating]:
63
- assert _check_valid_array(k)
64
- assert direction in ["x", "y"]
65
-
66
- hopping = self.hopping
67
- lattice_constant = self.lattice.lattice_constant
68
- if k.ndim == 1:
69
- k = np.expand_dims(k, axis=0)
70
-
71
- h = np.zeros((k.shape[0], self.number_of_bands, self.number_of_bands), dtype=np.complex128)
72
-
73
- if direction == "x":
74
- h[:, 0, 1] = (
75
- hopping
76
- * lattice_constant
77
- * np.exp(-0.5j * lattice_constant / np.sqrt(3) * k[:, 1])
78
- * np.sin(0.5 * lattice_constant * k[:, 0])
79
- )
80
- h[:, 1, 0] = h[:, 0, 1].conjugate()
81
- else:
82
- h[:, 0, 1] = (
83
- -hopping
84
- * 1j
85
- * lattice_constant
86
- / np.sqrt(3)
87
- * (
88
- np.exp(1j * lattice_constant / np.sqrt(3) * k[:, 1])
89
- - np.exp(-0.5j * lattice_constant / np.sqrt(3) * k[:, 1])
90
- * np.cos(0.5 * lattice_constant * k[:, 0])
91
- )
92
- )
93
- h[:, 1, 0] = h[:, 0, 1].conjugate()
94
-
95
- return h.squeeze()
@@ -1,70 +0,0 @@
1
- # SPDX-FileCopyrightText: 2024 Tjark Sievers
2
- # SPDX-FileCopyrightText: 2025 Tjark Sievers
3
- #
4
- # SPDX-License-Identifier: MIT
5
-
6
- """Provides the implementation for a one band tight binding model."""
7
-
8
- import numpy as np
9
- import numpy.typing as npt
10
-
11
- from quant_met.geometry import SquareLattice
12
- from quant_met.mean_field._utils import _check_valid_array
13
- from quant_met.parameters import OneBandParameters
14
-
15
- from .base_hamiltonian import BaseHamiltonian
16
-
17
-
18
- class OneBand(BaseHamiltonian[OneBandParameters]):
19
- """Hamiltonian for one band tight binding model."""
20
-
21
- def __init__(self, parameters: OneBandParameters) -> None:
22
- super().__init__(parameters)
23
- self.hopping = parameters.hopping
24
- self.chemical_potential = parameters.chemical_potential
25
- if parameters.delta is not None:
26
- self.delta_orbital_basis = parameters.delta.astype(np.complex128)
27
-
28
- def setup_lattice(self, parameters: OneBandParameters) -> SquareLattice: # noqa: D102
29
- return SquareLattice(lattice_constant=parameters.lattice_constant)
30
-
31
- @classmethod
32
- def get_parameters_model(cls) -> type[OneBandParameters]: # noqa: D102
33
- return OneBandParameters
34
-
35
- def hamiltonian(self, k: npt.NDArray[np.floating]) -> npt.NDArray[np.complexfloating]: # noqa: D102
36
- assert _check_valid_array(k)
37
- hopping = self.hopping
38
- lattice_constant = self.lattice.lattice_constant
39
- chemical_potential = self.chemical_potential
40
- if k.ndim == 1:
41
- k = np.expand_dims(k, axis=0)
42
-
43
- h = np.zeros((k.shape[0], self.number_of_bands, self.number_of_bands), dtype=np.complex128)
44
-
45
- h[:, 0, 0] = (
46
- -2 * hopping * (np.cos(k[:, 1] * lattice_constant) + np.cos(k[:, 0] * lattice_constant))
47
- )
48
- h[:, 0, 0] -= chemical_potential
49
-
50
- return h
51
-
52
- def hamiltonian_derivative( # noqa: D102
53
- self, k: npt.NDArray[np.floating], direction: str
54
- ) -> npt.NDArray[np.complexfloating]:
55
- assert _check_valid_array(k)
56
- assert direction in ["x", "y"]
57
-
58
- hopping = self.hopping
59
- lattice_constant = self.lattice.lattice_constant
60
- if k.ndim == 1:
61
- k = np.expand_dims(k, axis=0)
62
-
63
- h = np.zeros((k.shape[0], self.number_of_bands, self.number_of_bands), dtype=np.complex128)
64
-
65
- if direction == "x":
66
- h[:, 0, 0] = -2 * hopping * lattice_constant * np.sin(lattice_constant * k[:, 0])
67
- else:
68
- h[:, 0, 0] = -2 * hopping * lattice_constant * np.sin(lattice_constant * k[:, 0])
69
-
70
- return h.squeeze()
@@ -1,85 +0,0 @@
1
- # SPDX-FileCopyrightText: 2024 Tjark Sievers
2
- # SPDX-FileCopyrightText: 2025 Tjark Sievers
3
- #
4
- # SPDX-License-Identifier: MIT
5
-
6
- """Provides the implementation for a three band tight binding model."""
7
-
8
- import numpy as np
9
- import numpy.typing as npt
10
-
11
- from quant_met.geometry import SquareLattice
12
- from quant_met.mean_field._utils import _check_valid_array
13
- from quant_met.parameters import ThreeBandParameters
14
-
15
- from .base_hamiltonian import BaseHamiltonian
16
-
17
-
18
- class ThreeBand(BaseHamiltonian[ThreeBandParameters]):
19
- """Hamiltonian for Graphene."""
20
-
21
- def __init__(self, parameters: ThreeBandParameters) -> None:
22
- super().__init__(parameters)
23
- self.hopping = parameters.hopping
24
- self.chemical_potential = parameters.chemical_potential
25
- if parameters.delta is not None:
26
- self.delta_orbital_basis = parameters.delta.astype(np.complex128)
27
-
28
- def setup_lattice(self, parameters: ThreeBandParameters) -> SquareLattice: # noqa: D102
29
- return SquareLattice(lattice_constant=parameters.lattice_constant)
30
-
31
- @classmethod
32
- def get_parameters_model(cls) -> type[ThreeBandParameters]: # noqa: D102
33
- return ThreeBandParameters
34
-
35
- def hamiltonian(self, k: npt.NDArray[np.floating]) -> npt.NDArray[np.complexfloating]: # noqa: D102
36
- assert _check_valid_array(k)
37
- hopping = self.hopping
38
- lattice_constant = self.lattice.lattice_constant
39
- chemical_potential = self.chemical_potential
40
- if k.ndim == 1:
41
- k = np.expand_dims(k, axis=0)
42
-
43
- h = np.zeros((k.shape[0], self.number_of_bands, self.number_of_bands), dtype=np.complex128)
44
-
45
- h[:, 0, 0] = (
46
- -2 * hopping * (np.cos(k[:, 1] * lattice_constant) + np.cos(k[:, 0] * lattice_constant))
47
- )
48
- h[:, 1, 1] = (
49
- -2 * hopping * (np.cos(k[:, 1] * lattice_constant) + np.cos(k[:, 0] * lattice_constant))
50
- )
51
- h[:, 2, 2] = (
52
- -2 * hopping * (np.cos(k[:, 1] * lattice_constant) + np.cos(k[:, 0] * lattice_constant))
53
- )
54
- h[:, 2, 0] = 0.5
55
- h[:, 0, 2] = 0.5
56
-
57
- h[:, 0, 0] -= chemical_potential
58
- h[:, 1, 1] -= chemical_potential
59
- h[:, 2, 2] -= chemical_potential
60
-
61
- return h.squeeze()
62
-
63
- def hamiltonian_derivative( # noqa: D102
64
- self, k: npt.NDArray[np.floating], direction: str
65
- ) -> npt.NDArray[np.complexfloating]:
66
- assert _check_valid_array(k)
67
- assert direction in ["x", "y"]
68
-
69
- hopping = self.hopping
70
- lattice_constant = self.lattice.lattice_constant
71
- if k.ndim == 1:
72
- k = np.expand_dims(k, axis=0)
73
-
74
- h = np.zeros((k.shape[0], self.number_of_bands, self.number_of_bands), dtype=np.complex128)
75
-
76
- if direction == "x":
77
- h[:, 0, 0] = -2 * hopping * lattice_constant * np.sin(lattice_constant * k[:, 0])
78
- h[:, 1, 1] = -2 * hopping * lattice_constant * np.sin(lattice_constant * k[:, 0])
79
- h[:, 2, 2] = -2 * hopping * lattice_constant * np.sin(lattice_constant * k[:, 0])
80
- else:
81
- h[:, 0, 0] = -2 * hopping * lattice_constant * np.sin(lattice_constant * k[:, 0])
82
- h[:, 1, 1] = -2 * hopping * lattice_constant * np.sin(lattice_constant * k[:, 0])
83
- h[:, 2, 2] = -2 * hopping * lattice_constant * np.sin(lattice_constant * k[:, 0])
84
-
85
- return h.squeeze()
@@ -1,76 +0,0 @@
1
- # SPDX-FileCopyrightText: 2024 Tjark Sievers
2
- # SPDX-FileCopyrightText: 2025 Tjark Sievers
3
- #
4
- # SPDX-License-Identifier: MIT
5
-
6
- """Provides the implementation for a two band tight binding model."""
7
-
8
- import numpy as np
9
- import numpy.typing as npt
10
-
11
- from quant_met.geometry import SquareLattice
12
- from quant_met.mean_field._utils import _check_valid_array
13
- from quant_met.parameters import TwoBandParameters
14
-
15
- from .base_hamiltonian import BaseHamiltonian
16
-
17
-
18
- class TwoBand(BaseHamiltonian[TwoBandParameters]):
19
- """Hamiltonian for Graphene."""
20
-
21
- def __init__(self, parameters: TwoBandParameters) -> None:
22
- super().__init__(parameters)
23
- self.hopping = parameters.hopping
24
- self.chemical_potential = parameters.chemical_potential
25
- if parameters.delta is not None:
26
- self.delta_orbital_basis = parameters.delta.astype(np.complex128)
27
-
28
- def setup_lattice(self, parameters: TwoBandParameters) -> SquareLattice: # noqa: D102
29
- return SquareLattice(lattice_constant=parameters.lattice_constant)
30
-
31
- @classmethod
32
- def get_parameters_model(cls) -> type[TwoBandParameters]: # noqa: D102
33
- return TwoBandParameters
34
-
35
- def hamiltonian(self, k: npt.NDArray[np.floating]) -> npt.NDArray[np.complexfloating]: # noqa: D102
36
- assert _check_valid_array(k)
37
- hopping = self.hopping
38
- lattice_constant = self.lattice.lattice_constant
39
- chemical_potential = self.chemical_potential
40
- if k.ndim == 1:
41
- k = np.expand_dims(k, axis=0)
42
-
43
- h = np.zeros((k.shape[0], self.number_of_bands, self.number_of_bands), dtype=np.complex128)
44
-
45
- h[:, 0, 0] = (
46
- -2 * hopping * (np.cos(k[:, 1] * lattice_constant) + np.cos(k[:, 0] * lattice_constant))
47
- )
48
- h[:, 1, 1] = (
49
- -2 * hopping * (np.cos(k[:, 1] * lattice_constant) + np.cos(k[:, 0] * lattice_constant))
50
- )
51
- h[:, 0, 0] -= chemical_potential
52
- h[:, 1, 1] -= chemical_potential
53
-
54
- return h.squeeze()
55
-
56
- def hamiltonian_derivative( # noqa: D102
57
- self, k: npt.NDArray[np.floating], direction: str
58
- ) -> npt.NDArray[np.complexfloating]:
59
- assert _check_valid_array(k)
60
- assert direction in ["x", "y"]
61
-
62
- hopping = self.hopping
63
- lattice_constant = self.lattice.lattice_constant
64
- if k.ndim == 1:
65
- k = np.expand_dims(k, axis=0)
66
-
67
- h = np.zeros((k.shape[0], self.number_of_bands, self.number_of_bands), dtype=np.complex128)
68
-
69
- if direction == "x":
70
- h[:, 0, 0] = -2 * hopping * lattice_constant * np.sin(lattice_constant * k[:, 0])
71
- h[:, 1, 1] = -2 * hopping * lattice_constant * np.sin(lattice_constant * k[:, 0])
72
- else:
73
- h[:, 0, 0] = -2 * hopping * lattice_constant * np.sin(lattice_constant * k[:, 0])
74
- h[:, 1, 1] = -2 * hopping * lattice_constant * np.sin(lattice_constant * k[:, 0])
75
-
76
- return h.squeeze()
@@ -1,182 +0,0 @@
1
- # SPDX-FileCopyrightText: 2024 Tjark Sievers
2
- # SPDX-FileCopyrightText: 2025 Tjark Sievers
3
- #
4
- # SPDX-License-Identifier: MIT
5
-
6
- """
7
- hamiltonians
8
- ============
9
-
10
- Classes holding the configuration for the Hamiltonians.
11
-
12
- .. autosummary::
13
- :toctree:
14
- :template: autosummary/pydantic.rst
15
-
16
- HamiltonianParameters
17
- DressedGrapheneParameters
18
- GrapheneParameters
19
- OneBandParameters
20
- TwoBandParameters
21
- ThreeBandParameters
22
- """ # noqa: D205, D400
23
-
24
- from typing import Literal, TypeVar
25
-
26
- import numpy as np
27
- from numpydantic import NDArray, Shape
28
- from pydantic import BaseModel, Field, field_validator
29
- from pydantic_core.core_schema import ValidationInfo
30
-
31
- GenericParameters = TypeVar("GenericParameters", bound="HamiltonianParameters")
32
-
33
-
34
- def check_positive_values(value: float, info: ValidationInfo) -> float:
35
- """Check for positive values."""
36
- if value < 0:
37
- msg = f"{info.field_name} must be positive"
38
- raise ValueError(msg)
39
- return value
40
-
41
-
42
- def validate_float(value: float, info: ValidationInfo) -> float:
43
- """Check for valid floats."""
44
- if np.isinf(value):
45
- msg = f"{info.field_name} must not be Infinity"
46
- raise ValueError(msg)
47
- if np.isnan(value):
48
- msg = f"{info.field_name} must not be NaN"
49
- raise ValueError(msg)
50
- return value
51
-
52
-
53
- class HamiltonianParameters(BaseModel):
54
- """Base class for Hamiltonian parameters."""
55
-
56
- name: str
57
- """The name of the Hamiltonian model (e.g., "Graphene", "DressedGraphene")."""
58
- hubbard_int_orbital_basis: NDArray
59
- """A numpy array representing the Hubbard interactions in the orbital basis."""
60
- beta: float = np.inf
61
- """The inverse temperature; default is set to infinity."""
62
- q: NDArray[Shape["2"], float] | None = None
63
- """An optional numpy array representing the momentum of Cooper pairs."""
64
-
65
-
66
- class DressedGrapheneParameters(HamiltonianParameters):
67
- """Parameters for the Dressed Graphene model.
68
-
69
- Attributes
70
- ----------
71
- hopping_gr : float
72
- Hopping parameter in the graphene layer.
73
- hopping_x : float
74
- Hopping parameter at the impurity site.
75
- hopping_x_gr_a : float
76
- Hybridization parameter.
77
- lattice_constant : float
78
- The lattice constant of the model.
79
- chemical_potential : float
80
- The chemical potential.
81
- hubbard_int_orbital_basis : npt.NDArray[np.floating]
82
- Hubbard interaction in the orbital basis.
83
- delta : npt.NDArray[np.complexfloating] | None
84
- Initial value for gaps in orbital space.
85
- """
86
-
87
- name: Literal["DressedGraphene"] = "DressedGraphene"
88
- hopping_gr: float = Field(..., description="Hopping in graphene")
89
- hopping_x: float = Field(..., description="Hopping in impurity")
90
- hopping_x_gr_a: float = Field(..., description="Hybridization")
91
- lattice_constant: float = Field(..., description="Lattice constant")
92
- chemical_potential: float = Field(..., description="Chemical potential")
93
- hubbard_int_orbital_basis: NDArray[Shape["3"], np.float64] = Field(
94
- ..., description="Hubbard interaction in orbital basis"
95
- )
96
- delta: NDArray[Shape["3"], np.complex128] | None = Field(
97
- default=None, description="Initial value for gaps in orbital space"
98
- )
99
-
100
- _check_positive_values = field_validator(
101
- "hopping_gr", "hopping_x", "hopping_x_gr_a", "lattice_constant"
102
- )(check_positive_values)
103
-
104
- _check_valid_floats = field_validator(
105
- "hopping_gr", "hopping_x", "hopping_x_gr_a", "lattice_constant", "chemical_potential"
106
- )(validate_float)
107
-
108
-
109
- class GrapheneParameters(HamiltonianParameters):
110
- """Parameters for Graphene model."""
111
-
112
- name: Literal["Graphene"] = "Graphene"
113
- hopping: float
114
- lattice_constant: float
115
- chemical_potential: float
116
- hubbard_int_orbital_basis: NDArray[Shape["2"], np.float64] = Field(
117
- ..., description="Hubbard interaction in orbital basis"
118
- )
119
- delta: NDArray[Shape["2"], np.complex128] | None = None
120
-
121
- _check_positive_values = field_validator("hopping", "lattice_constant")(check_positive_values)
122
-
123
- _check_valid_floats = field_validator("hopping", "lattice_constant", "chemical_potential")(
124
- validate_float
125
- )
126
-
127
-
128
- class OneBandParameters(HamiltonianParameters):
129
- """Parameters for Graphene model."""
130
-
131
- name: Literal["OneBand"] = "OneBand"
132
- hopping: float
133
- lattice_constant: float
134
- chemical_potential: float
135
- hubbard_int_orbital_basis: NDArray[Shape["1"], np.floating] = Field(
136
- ..., description="Hubbard interaction in orbital basis"
137
- )
138
- delta: NDArray[Shape["1"], np.complex128] | None = None
139
-
140
- _check_positive_values = field_validator("hopping", "lattice_constant")(check_positive_values)
141
-
142
- _check_valid_floats = field_validator("hopping", "lattice_constant", "chemical_potential")(
143
- validate_float
144
- )
145
-
146
-
147
- class TwoBandParameters(HamiltonianParameters):
148
- """Parameters for Graphene model."""
149
-
150
- name: Literal["TwoBand"] = "TwoBand"
151
- hopping: float
152
- lattice_constant: float
153
- chemical_potential: float
154
- hubbard_int_orbital_basis: NDArray[Shape["2"], np.float64] = Field(
155
- ..., description="Hubbard interaction in orbital basis"
156
- )
157
- delta: NDArray[Shape["2"], np.complexfloating] | None = None
158
-
159
- _check_positive_values = field_validator("hopping", "lattice_constant")(check_positive_values)
160
-
161
- _check_valid_floats = field_validator("hopping", "lattice_constant", "chemical_potential")(
162
- validate_float
163
- )
164
-
165
-
166
- class ThreeBandParameters(HamiltonianParameters):
167
- """Parameters for Graphene model."""
168
-
169
- name: Literal["ThreeBand"] = "ThreeBand"
170
- hopping: float
171
- lattice_constant: float
172
- chemical_potential: float
173
- hubbard_int_orbital_basis: NDArray[Shape["3"], np.float64] = Field(
174
- ..., description="Hubbard interaction in orbital basis"
175
- )
176
- delta: NDArray[Shape["3"], np.complex128] | None = None
177
-
178
- _check_positive_values = field_validator("hopping", "lattice_constant")(check_positive_values)
179
-
180
- _check_valid_floats = field_validator("hopping", "lattice_constant", "chemical_potential")(
181
- validate_float
182
- )
@@ -1,31 +0,0 @@
1
- # SPDX-FileCopyrightText: 2024 Tjark Sievers
2
- # SPDX-FileCopyrightText: 2025 Tjark Sievers
3
- #
4
- # SPDX-License-Identifier: MIT
5
-
6
- """
7
- Plotting
8
- ========
9
-
10
- .. currentmodule:: quant_met.plotting
11
-
12
- Functions
13
- ---------
14
-
15
- .. autosummary::
16
- :toctree: generated/
17
-
18
- format_plot
19
- scatter_into_bz
20
- plot_bandstructure
21
- plot_superfluid_weight
22
- """ # noqa: D205, D400
23
-
24
- from .plotting import format_plot, plot_bandstructure, plot_superfluid_weight, scatter_into_bz
25
-
26
- __all__ = [
27
- "format_plot",
28
- "plot_bandstructure",
29
- "plot_superfluid_weight",
30
- "scatter_into_bz",
31
- ]