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