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,100 +0,0 @@
1
- # SPDX-FileCopyrightText: 2024 Tjark Sievers
2
- # SPDX-FileCopyrightText: 2025 Tjark Sievers
3
- #
4
- # SPDX-License-Identifier: MIT
5
-
6
- """Base class for lattice geometries."""
7
-
8
- from abc import ABC, abstractmethod
9
-
10
- import numpy as np
11
- import numpy.typing as npt
12
-
13
- from quant_met.utils import generate_uniform_grid
14
-
15
- from .bz_path import generate_bz_path
16
-
17
-
18
- class BaseLattice(ABC):
19
- """Base class for lattice geometries."""
20
-
21
- @property
22
- @abstractmethod
23
- def lattice_constant(self) -> float: # pragma: no cover
24
- """Lattice constant."""
25
- raise NotImplementedError
26
-
27
- @property
28
- @abstractmethod
29
- def bz_corners(self) -> npt.NDArray[np.floating]: # pragma: no cover
30
- """Corners of the BZ."""
31
- raise NotImplementedError
32
-
33
- @property
34
- @abstractmethod
35
- def reciprocal_basis(
36
- self,
37
- ) -> tuple[npt.NDArray[np.floating], npt.NDArray[np.floating]]: # pragma: no cover
38
- """Reciprocal basis vectors."""
39
- raise NotImplementedError
40
-
41
- @property
42
- @abstractmethod
43
- def high_symmetry_points(
44
- self,
45
- ) -> tuple[tuple[npt.NDArray[np.floating], str], ...]: # pragma: no cover
46
- """Tuple of high symmetry points and names."""
47
- raise NotImplementedError
48
-
49
- def generate_bz_grid(self, ncols: int, nrows: int) -> npt.NDArray[np.floating]:
50
- """Generate a grid in the BZ.
51
-
52
- Parameters
53
- ----------
54
- ncols : int
55
- Number of points in column.
56
- nrows : int
57
- Number of points in row.
58
-
59
- Returns
60
- -------
61
- :class:`numpy.ndarray`
62
- Array of grid points in the BZ.
63
-
64
- """
65
- return generate_uniform_grid(
66
- ncols,
67
- nrows,
68
- self.reciprocal_basis[0],
69
- self.reciprocal_basis[1],
70
- origin=np.array([0, 0]),
71
- )
72
-
73
- def generate_high_symmetry_path(
74
- self, number_of_points: int
75
- ) -> tuple[
76
- npt.NDArray[np.floating],
77
- npt.NDArray[np.floating],
78
- list[float],
79
- list[str],
80
- ]:
81
- """Generate a path through high symmetry points.
82
-
83
- Parameters
84
- ----------
85
- number_of_points: int
86
- Number of point in the whole path.
87
-
88
- Returns
89
- -------
90
- :class:`numpy.ndarray`
91
- List of two-dimensional k points.
92
- :class:`numpy.ndarray`
93
- Path for plotting purposes: points between 0 and 1, with appropriate spacing.
94
- list[float]
95
- A list of ticks for the plotting path.
96
- list[str]
97
- A list of labels for the plotting path.
98
-
99
- """
100
- return generate_bz_path(list(self.high_symmetry_points), number_of_points=number_of_points)
@@ -1,90 +0,0 @@
1
- # SPDX-FileCopyrightText: 2024 Tjark Sievers
2
- # SPDX-FileCopyrightText: 2025 Tjark Sievers
3
- #
4
- # SPDX-License-Identifier: MIT
5
-
6
- """Methods to generate paths through the BZ."""
7
-
8
- import numpy as np
9
- import numpy.typing as npt
10
-
11
-
12
- def _generate_part_of_path(
13
- p_0: npt.NDArray[np.floating],
14
- p_1: npt.NDArray[np.floating],
15
- n: int,
16
- length_whole_path: int,
17
- ) -> npt.NDArray[np.floating]:
18
- distance = np.linalg.norm(p_1 - p_0)
19
- number_of_points = int(n * distance / length_whole_path) + 1
20
-
21
- return np.vstack(
22
- [
23
- np.linspace(p_0[0], p_1[0], number_of_points),
24
- np.linspace(p_0[1], p_1[1], number_of_points),
25
- ]
26
- ).T[:-1]
27
-
28
-
29
- def generate_bz_path(
30
- points: list[tuple[npt.NDArray[np.floating], str]], number_of_points: int = 1000
31
- ) -> tuple[
32
- npt.NDArray[np.floating],
33
- npt.NDArray[np.floating],
34
- list[float],
35
- list[str],
36
- ]:
37
- """Generate a path through high symmetry points.
38
-
39
- Parameters
40
- ----------
41
- points : :class:`numpy.ndarray`
42
- Test
43
- number_of_points: int
44
- Number of point in the whole path.
45
-
46
- Returns
47
- -------
48
- :class:`numpy.ndarray`
49
- List of two-dimensional k points.
50
- :class:`numpy.ndarray`
51
- Path for plotting purposes: points between 0 and 1, with appropriate spacing.
52
- list[float]
53
- A list of ticks for the plotting path.
54
- list[str]
55
- A list of labels for the plotting path.
56
-
57
- """
58
- n = number_of_points
59
-
60
- cycle = [np.linalg.norm(points[i][0] - points[i + 1][0]) for i in range(len(points) - 1)]
61
- cycle.append(np.linalg.norm(points[-1][0] - points[0][0]))
62
-
63
- length_whole_path = np.sum(np.array([cycle]))
64
-
65
- ticks = [0.0]
66
- ticks.extend([np.sum(cycle[0 : i + 1]) / length_whole_path for i in range(len(cycle) - 1)])
67
- ticks.append(1.0)
68
- labels = [rf"${points[i][1]}$" for i in range(len(points))]
69
- labels.append(rf"${points[0][1]}$")
70
-
71
- whole_path_plot = np.concatenate(
72
- [
73
- np.linspace(
74
- ticks[i],
75
- ticks[i + 1],
76
- num=int(n * cycle[i] / length_whole_path),
77
- endpoint=False,
78
- )
79
- for i in range(len(ticks) - 1)
80
- ]
81
- )
82
-
83
- points_path = [
84
- _generate_part_of_path(points[i][0], points[i + 1][0], n, length_whole_path)
85
- for i in range(len(points) - 1)
86
- ]
87
- points_path.append(_generate_part_of_path(points[-1][0], points[0][0], n, length_whole_path))
88
- whole_path = np.concatenate(points_path)
89
-
90
- return whole_path, whole_path_plot, ticks, labels
@@ -1,48 +0,0 @@
1
- # SPDX-FileCopyrightText: 2024 Tjark Sievers
2
- # SPDX-FileCopyrightText: 2025 Tjark Sievers
3
- #
4
- # SPDX-License-Identifier: MIT
5
-
6
- """Lattice geometry for Graphene."""
7
-
8
- import numpy as np
9
- import numpy.typing as npt
10
-
11
- from .base_lattice import BaseLattice
12
-
13
-
14
- class GrapheneLattice(BaseLattice):
15
- """Lattice geometry for Graphene."""
16
-
17
- def __init__(self, lattice_constant: float) -> None:
18
- self._lattice_constant = lattice_constant
19
- self._bz_corners = (
20
- 4
21
- * np.pi
22
- / (3 * self.lattice_constant)
23
- * np.array([(np.cos(i * np.pi / 3), np.sin(i * np.pi / 3)) for i in range(6)])
24
- )
25
- self.Gamma = np.array([0, 0])
26
- self.M = np.pi / self.lattice_constant * np.array([1, 1 / np.sqrt(3)])
27
- self.K = 4 * np.pi / (3 * self.lattice_constant) * np.array([1, 0])
28
- self._high_symmetry_points = ((self.M, "M"), (self.Gamma, r"\Gamma"), (self.K, "K"))
29
- self._reciprocal_basis = (
30
- 2 * np.pi / self.lattice_constant * np.array([1, 1 / np.sqrt(3)]),
31
- 2 * np.pi / self.lattice_constant * np.array([1, -1 / np.sqrt(3)]),
32
- )
33
-
34
- @property
35
- def lattice_constant(self) -> float: # noqa: D102
36
- return self._lattice_constant
37
-
38
- @property
39
- def bz_corners(self) -> npt.NDArray[np.floating]: # noqa: D102
40
- return self._bz_corners
41
-
42
- @property
43
- def reciprocal_basis(self) -> tuple[npt.NDArray[np.floating], npt.NDArray[np.floating]]: # noqa: D102
44
- return self._reciprocal_basis
45
-
46
- @property
47
- def high_symmetry_points(self) -> tuple[tuple[npt.NDArray[np.floating], str], ...]: # noqa: D102
48
- return self._high_symmetry_points
@@ -1,47 +0,0 @@
1
- # SPDX-FileCopyrightText: 2024 Tjark Sievers
2
- # SPDX-FileCopyrightText: 2025 Tjark Sievers
3
- #
4
- # SPDX-License-Identifier: MIT
5
-
6
- """Lattice geometry for Square Lattice."""
7
-
8
- import numpy as np
9
- import numpy.typing as npt
10
-
11
- from .base_lattice import BaseLattice
12
-
13
-
14
- class SquareLattice(BaseLattice):
15
- """Lattice geometry for Square Lattice."""
16
-
17
- def __init__(self, lattice_constant: float) -> None:
18
- self._lattice_constant = lattice_constant
19
- self._bz_corners = (
20
- np.pi
21
- / lattice_constant
22
- * np.array([np.array([1, 1]), np.array([-1, 1]), np.array([1, -1]), np.array([-1, -1])])
23
- )
24
- self._reciprocal_basis = (
25
- 2 * np.pi / self.lattice_constant * np.array([1, 0]),
26
- 2 * np.pi / self.lattice_constant * np.array([0, 1]),
27
- )
28
- self.Gamma = np.array([0, 0])
29
- self.M = np.pi / lattice_constant * np.array([1, 1])
30
- self.X = np.pi / lattice_constant * np.array([1, 0])
31
- self._high_symmetry_points = ((self.Gamma, r"\Gamma"), (self.M, "M"))
32
-
33
- @property
34
- def lattice_constant(self) -> float: # noqa: D102
35
- return self._lattice_constant
36
-
37
- @property
38
- def bz_corners(self) -> npt.NDArray[np.floating]: # noqa: D102 # pragma: no cover
39
- return self._bz_corners
40
-
41
- @property
42
- def reciprocal_basis(self) -> tuple[npt.NDArray[np.floating], npt.NDArray[np.floating]]: # noqa: D102
43
- return self._reciprocal_basis
44
-
45
- @property
46
- def high_symmetry_points(self) -> tuple[tuple[npt.NDArray[np.floating], str], ...]: # noqa: D102
47
- return self._high_symmetry_points
@@ -1,38 +0,0 @@
1
- # SPDX-FileCopyrightText: 2024 Tjark Sievers
2
- # SPDX-FileCopyrightText: 2025 Tjark Sievers
3
- #
4
- # SPDX-License-Identifier: MIT
5
-
6
- """
7
- Mean field
8
- ==========
9
-
10
- Submodules
11
- ----------
12
-
13
- .. autosummary::
14
- :toctree: generated/
15
-
16
- hamiltonians
17
-
18
-
19
- Functions
20
- ---------
21
-
22
- .. autosummary::
23
- :toctree: generated/
24
-
25
- self_consistency_loop
26
- search_crit_temp
27
- """ # noqa: D205, D400
28
-
29
- from quant_met.mean_field import hamiltonians
30
-
31
- from .search_crit_temp import search_crit_temp
32
- from .self_consistency import self_consistency_loop
33
-
34
- __all__ = [
35
- "hamiltonians",
36
- "search_crit_temp",
37
- "self_consistency_loop",
38
- ]
@@ -1,17 +0,0 @@
1
- # SPDX-FileCopyrightText: 2024 Tjark Sievers
2
- # SPDX-FileCopyrightText: 2025 Tjark Sievers
3
- #
4
- # SPDX-License-Identifier: MIT
5
-
6
- from typing import Any
7
-
8
- import numpy as np
9
- import numpy.typing as npt
10
-
11
-
12
- def _check_valid_array(array_in: npt.NDArray[Any]) -> bool:
13
- if np.isnan(array_in).any() or np.isinf(array_in).any():
14
- msg = "k is NaN or Infinity"
15
- raise ValueError(msg)
16
-
17
- return True
@@ -1,34 +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
- Base
11
-
12
- .. autosummary::
13
- :toctree: hamiltonians/
14
-
15
- BaseHamiltonian
16
-
17
- .. autosummary::
18
- :toctree: hamiltonians/
19
-
20
- Graphene
21
- DressedGraphene
22
- OneBand
23
- TwoBand
24
- ThreeBand
25
- """ # noqa: D205, D400
26
-
27
- from .base_hamiltonian import BaseHamiltonian
28
- from .dressed_graphene import DressedGraphene
29
- from .graphene import Graphene
30
- from .one_band_tight_binding import OneBand
31
- from .three_band_tight_binding import ThreeBand
32
- from .two_band_tight_binding import TwoBand
33
-
34
- __all__ = ["BaseHamiltonian", "DressedGraphene", "Graphene", "OneBand", "ThreeBand", "TwoBand"]