quant-met 0.1.2__tar.gz → 0.1.3__tar.gz

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 (96) hide show
  1. {quant_met-0.1.2 → quant_met-0.1.3}/.github/workflows/check_version.yml +2 -2
  2. {quant_met-0.1.2 → quant_met-0.1.3}/.github/workflows/integration_tests.yml +2 -2
  3. {quant_met-0.1.2 → quant_met-0.1.3}/.github/workflows/linting.yml +2 -2
  4. {quant_met-0.1.2 → quant_met-0.1.3}/.github/workflows/publish.yml +1 -1
  5. {quant_met-0.1.2 → quant_met-0.1.3}/.github/workflows/typing.yml +2 -2
  6. {quant_met-0.1.2 → quant_met-0.1.3}/.github/workflows/unit_tests.yml +1 -1
  7. {quant_met-0.1.2 → quant_met-0.1.3}/CHANGELOG.rst +10 -0
  8. {quant_met-0.1.2 → quant_met-0.1.3}/PKG-INFO +1 -1
  9. {quant_met-0.1.2 → quant_met-0.1.3}/pyproject.toml +1 -1
  10. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/bdg/bdg_hamiltonian.py +2 -5
  11. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/bdg/gap_equation.py +1 -1
  12. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/bdg/superfluid_weight.py +3 -1
  13. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/cli/q_loop.py +4 -1
  14. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/parameters/control.py +2 -2
  15. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/routines/search_crit_temp.py +2 -2
  16. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/routines/self_consistency.py +1 -1
  17. {quant_met-0.1.2 → quant_met-0.1.3}/tests/test_bdg.py +2 -1
  18. {quant_met-0.1.2 → quant_met-0.1.3}/tests/test_scf.py +1 -0
  19. {quant_met-0.1.2 → quant_met-0.1.3}/uv.lock +1455 -1457
  20. {quant_met-0.1.2 → quant_met-0.1.3}/.coveragerc +0 -0
  21. {quant_met-0.1.2 → quant_met-0.1.3}/.github/codspeed.yml +0 -0
  22. {quant_met-0.1.2 → quant_met-0.1.3}/.github/dependabot.yml +0 -0
  23. {quant_met-0.1.2 → quant_met-0.1.3}/.gitignore +0 -0
  24. {quant_met-0.1.2 → quant_met-0.1.3}/.pre-commit-config.yaml +0 -0
  25. {quant_met-0.1.2 → quant_met-0.1.3}/.readthedocs.yaml +0 -0
  26. {quant_met-0.1.2 → quant_met-0.1.3}/.vscode/settings.json +0 -0
  27. {quant_met-0.1.2 → quant_met-0.1.3}/LICENSE.txt +0 -0
  28. {quant_met-0.1.2 → quant_met-0.1.3}/Makefile +0 -0
  29. {quant_met-0.1.2 → quant_met-0.1.3}/README.md +0 -0
  30. {quant_met-0.1.2 → quant_met-0.1.3}/changelog.d/scriv.ini +0 -0
  31. {quant_met-0.1.2 → quant_met-0.1.3}/check_version.sh +0 -0
  32. {quant_met-0.1.2 → quant_met-0.1.3}/docs/Makefile +0 -0
  33. {quant_met-0.1.2 → quant_met-0.1.3}/docs/make.bat +0 -0
  34. {quant_met-0.1.2 → quant_met-0.1.3}/docs/requirements.txt +0 -0
  35. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/_static/custom.css +0 -0
  36. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/_templates/autosummary/attribute.rst +0 -0
  37. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/_templates/autosummary/class.rst +0 -0
  38. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/_templates/autosummary/function.rst +0 -0
  39. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/_templates/autosummary/method.rst +0 -0
  40. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/_templates/autosummary/module.rst +0 -0
  41. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/_templates/autosummary/property.rst +0 -0
  42. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/changelog.rst +0 -0
  43. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/conf.py +0 -0
  44. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/development.rst +0 -0
  45. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/examples/dec-graphene.HSX +0 -0
  46. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/examples/decorated_graphene_nonint.ipynb +0 -0
  47. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/examples/decorated_graphene_scf.ipynb +0 -0
  48. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/examples/decorated_graphene_sisl.ipynb +0 -0
  49. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/examples/example-crit-temp.yaml +0 -0
  50. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/examples/example-q-analysis-dec-graphene.yaml +0 -0
  51. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/examples/example-q-loop-dec-graphene.yaml +0 -0
  52. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/examples/example-q-loop-from-scratch.yaml +0 -0
  53. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/examples/example-q-loop.yaml +0 -0
  54. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/examples/example-scf.yaml +0 -0
  55. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/examples/hamiltonian.HSX +0 -0
  56. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/examples/test_sisl.ipynb +0 -0
  57. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/extra/versions.json +0 -0
  58. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/index.rst +0 -0
  59. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/reference/bdg.rst +0 -0
  60. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/reference/cli.rst +0 -0
  61. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/reference/generated/parameters/quant_met.parameters.Control.rst +0 -0
  62. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/reference/generated/parameters/quant_met.parameters.KPoints.rst +0 -0
  63. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/reference/generated/parameters/quant_met.parameters.Parameters.rst +0 -0
  64. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/reference/generated/quant_met.bdg.bdg_hamiltonian.rst +0 -0
  65. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/reference/generated/quant_met.bdg.calculate_current_density.rst +0 -0
  66. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/reference/generated/quant_met.bdg.calculate_superfluid_weight.rst +0 -0
  67. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/reference/generated/quant_met.bdg.diagonalize_bdg.rst +0 -0
  68. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/reference/generated/quant_met.bdg.gap_equation.rst +0 -0
  69. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/reference/generated/quant_met.cli.cli.rst +0 -0
  70. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/reference/generated/quant_met.quantum_geometry.calculate_qgt.rst +0 -0
  71. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/reference/generated/quant_met.routines.self_consistency_loop.rst +0 -0
  72. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/reference/index.rst +0 -0
  73. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/reference/parameters.rst +0 -0
  74. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/reference/quantum_geometry.rst +0 -0
  75. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/reference/routines.rst +0 -0
  76. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/user_guide/first-scf.rst +0 -0
  77. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/user_guide/search_T_C.rst +0 -0
  78. {quant_met-0.1.2 → quant_met-0.1.3}/docs/source/user_guide.rst +0 -0
  79. {quant_met-0.1.2 → quant_met-0.1.3}/justfile +0 -0
  80. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/__init__.py +0 -0
  81. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/bdg/__init__.py +0 -0
  82. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/bdg/sc_current.py +0 -0
  83. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/cli/__init__.py +0 -0
  84. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/cli/crit_temp.py +0 -0
  85. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/cli/main.py +0 -0
  86. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/cli/q_analysis.py +0 -0
  87. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/cli/scf.py +0 -0
  88. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/parameters/__init__.py +0 -0
  89. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/parameters/main.py +0 -0
  90. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/quantum_geometry/__init__.py +0 -0
  91. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/quantum_geometry/qgt.py +0 -0
  92. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/routines/__init__.py +0 -0
  93. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/routines/analyse_q_data.py +0 -0
  94. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/routines/loop_over_q.py +0 -0
  95. {quant_met-0.1.2 → quant_met-0.1.3}/src/quant_met/utils.py +0 -0
  96. {quant_met-0.1.2 → quant_met-0.1.3}/tests/conftest.py +0 -0
@@ -11,11 +11,11 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  if: ${{ startsWith(github.head_ref, 'release') }}
13
13
  steps:
14
- - uses: getsentry/action-setup-venv@v2.1.1
14
+ - uses: getsentry/action-setup-venv@v2.2.0
15
15
  id: venv
16
16
  with:
17
17
  python-version: 3.12.2
18
18
  install-cmd: pip install quant-met poetry
19
- - uses: actions/checkout@v4
19
+ - uses: actions/checkout@v5
20
20
  - name: check version
21
21
  run: ./check_version.sh
@@ -21,10 +21,10 @@ jobs:
21
21
  if: ${{ contains(github.event.head_commit.message, 'needs-integration') || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
22
22
  runs-on: ubuntu-latest
23
23
  steps:
24
- - uses: actions/checkout@v4
24
+ - uses: actions/checkout@v5
25
25
  with:
26
26
  fetch-depth: 0
27
- - uses: actions/checkout@v4
27
+ - uses: actions/checkout@v5
28
28
  - name: Install uv
29
29
  uses: astral-sh/setup-uv@v6
30
30
  - name: Install the project
@@ -17,11 +17,11 @@ jobs:
17
17
  name: Linting
18
18
  runs-on: ubuntu-latest
19
19
  steps:
20
- - uses: actions/checkout@v4
20
+ - uses: actions/checkout@v5
21
21
  with:
22
22
  fetch-depth: 0
23
23
  - name: Set up Python 3.12
24
- uses: actions/setup-python@v5
24
+ uses: actions/setup-python@v6
25
25
  with:
26
26
  python-version: "3.12"
27
27
  - name: Install uv
@@ -19,7 +19,7 @@ jobs:
19
19
  permissions:
20
20
  id-token: write
21
21
  steps:
22
- - uses: actions/checkout@v4
22
+ - uses: actions/checkout@v5
23
23
  - name: Install uv
24
24
  uses: astral-sh/setup-uv@v6
25
25
  - name: Build and publish to pypi
@@ -17,11 +17,11 @@ jobs:
17
17
  name: Type checking
18
18
  runs-on: ubuntu-latest
19
19
  steps:
20
- - uses: actions/checkout@v4
20
+ - uses: actions/checkout@v5
21
21
  with:
22
22
  fetch-depth: 0
23
23
  - name: Set up Python 3.12
24
- uses: actions/setup-python@v5
24
+ uses: actions/setup-python@v6
25
25
  with:
26
26
  python-version: "3.12"
27
27
  - name: Install uv
@@ -23,7 +23,7 @@ jobs:
23
23
  matrix:
24
24
  python-version: [ "3.11", "3.12", "3.13" ]
25
25
  steps:
26
- - uses: actions/checkout@v4
26
+ - uses: actions/checkout@v5
27
27
  with:
28
28
  fetch-depth: 0
29
29
  - name: Install uv
@@ -1,4 +1,14 @@
1
1
 
2
+ .. _changelog-0.1.3:
3
+
4
+ 0.1.3 — 2025-09-07
5
+ ------------------
6
+
7
+ Fixed
8
+ ^^^^^
9
+
10
+ - Add a default (0, 0, 0) for q in parameters
11
+
2
12
  .. _changelog-0.1.2:
3
13
 
4
14
  0.1.2 — 2025-07-27
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quant-met
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Calculate superconductivity in flat-band systems.
5
5
  Author-email: Tjark Sievers <tjarksievers@icloud.com>
6
6
  License-File: LICENSE.txt
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "quant-met"
3
- version = "0.1.2"
3
+ version = "0.1.3"
4
4
  description = "Calculate superconductivity in flat-band systems."
5
5
  authors = [{name="Tjark Sievers", email="tjarksievers@icloud.com"}]
6
6
  readme = "README.md"
@@ -9,7 +9,7 @@ def bdg_hamiltonian(
9
9
  hamiltonian: sisl.Hamiltonian,
10
10
  k: npt.NDArray[np.floating],
11
11
  delta_orbital_basis: npt.NDArray[np.complexfloating],
12
- q: npt.NDArray[np.floating] | None = None,
12
+ q: npt.NDArray[np.floating],
13
13
  ) -> npt.NDArray[np.complexfloating]:
14
14
  """
15
15
  Construct the BdG Hamiltonian at momentum k.
@@ -34,9 +34,6 @@ def bdg_hamiltonian(
34
34
  n_k_points = k.shape[0]
35
35
  n_orbitals = hamiltonian.no
36
36
 
37
- if q is None:
38
- q = np.zeros(3)
39
-
40
37
  h_bdg = np.zeros((n_k_points, 2 * n_orbitals, 2 * n_orbitals), dtype=np.complex128)
41
38
 
42
39
  for i, kpt in enumerate(k):
@@ -58,7 +55,7 @@ def diagonalize_bdg(
58
55
  hamiltonian: sisl.Hamiltonian,
59
56
  kgrid: sisl.MonkhorstPack,
60
57
  delta_orbital_basis: np.ndarray,
61
- q: npt.NDArray[np.floating] | None,
58
+ q: npt.NDArray[np.floating],
62
59
  ) -> tuple[npt.NDArray[np.float64], npt.NDArray[np.complex128]]:
63
60
  """Diagonalizes the BdG Hamiltonian.
64
61
 
@@ -14,7 +14,7 @@ def gap_equation( # noqa: PLR0913
14
14
  hubbard_int_orbital_basis: npt.NDArray[np.float64],
15
15
  delta_orbital_basis: npt.NDArray[np.complex128],
16
16
  kgrid: sisl.MonkhorstPack,
17
- q: npt.NDArray[np.float64] | None,
17
+ q: npt.NDArray[np.float64],
18
18
  ) -> npt.NDArray[np.complexfloating]:
19
19
  """Gap equation.
20
20
 
@@ -24,7 +24,9 @@ def calculate_superfluid_weight(
24
24
  k_tuple = tuple(k_point)
25
25
 
26
26
  # Solve BdG problem
27
- bdg_h = bdg_hamiltonian(hamiltonian, k_point, delta_orbital_basis)
27
+ bdg_h = bdg_hamiltonian(
28
+ hamiltonian, k_point, delta_orbital_basis, q=np.array([0.0, 0.0, 0.0])
29
+ )
28
30
  energies, wavefuncs = np.linalg.eigh(bdg_h)
29
31
 
30
32
  # Cache coefficient tensor
@@ -40,10 +40,13 @@ def q_loop(parameters: Parameters) -> None:
40
40
  delta_vs_temp, critical_temperatures, fit_fig = routines.search_crit_temp(
41
41
  hamiltonian=hamiltonian,
42
42
  kgrid=k_grid_obj,
43
- hubbard_int_orbital_basis=np.array(parameters.control.crit_temp.hubbard_int_orbital_basis),
43
+ hubbard_int_orbital_basis=np.array(
44
+ parameters.control.crit_temp.hubbard_int_orbital_basis
45
+ ),
44
46
  epsilon=parameters.control.crit_temp.conv_treshold,
45
47
  max_iter=parameters.control.crit_temp.max_iter,
46
48
  n_temp_points=20,
49
+ q=np.array([0.0, 0.0, 0.0]),
47
50
  )
48
51
  logger.info("Search for T_C completed successfully.")
49
52
  logger.info("Obtained T_Cs: %s", critical_temperatures)
@@ -25,7 +25,7 @@ class SCF(ControlBase):
25
25
  calculation: Literal["scf"]
26
26
  beta: float
27
27
  calculate_additional: bool = False
28
- q: FloatList | None = Field(..., min_length=2, max_length=2)
28
+ q: FloatList = [0.0, 0.0, 0.0]
29
29
 
30
30
 
31
31
  class CritTemp(ControlBase):
@@ -33,7 +33,7 @@ class CritTemp(ControlBase):
33
33
 
34
34
  calculation: Literal["crit-temp"]
35
35
  n_temp_points: int = 50
36
- q: FloatList | None = Field(..., min_length=2, max_length=2)
36
+ q: FloatList = [0.0, 0.0, 0.0]
37
37
 
38
38
 
39
39
  class QLoop(ControlBase):
@@ -136,9 +136,9 @@ def _gap_for_temp( # noqa: PLR0913
136
136
  kgrid: sisl.MonkhorstPack,
137
137
  hubbard_int_orbital_basis: npt.NDArray[np.float64],
138
138
  epsilon: float,
139
+ q: npt.NDArray[np.float64],
139
140
  max_iter: int = 1000,
140
141
  delta_init: npt.NDArray[np.complex128] | None = None,
141
- q: npt.NDArray[np.float64] | None = None,
142
142
  ) -> dict[str, Any] | None: # pragma: no cover
143
143
  beta = np.inf if temp == 0 else 1 / temp
144
144
  try:
@@ -170,7 +170,7 @@ def search_crit_temp( # noqa: PLR0913
170
170
  epsilon: float,
171
171
  max_iter: int,
172
172
  n_temp_points: int,
173
- q: npt.NDArray[np.float64] | None = None,
173
+ q: npt.NDArray[np.float64],
174
174
  beta_init: float | None = None,
175
175
  ) -> tuple[pd.DataFrame, list[float], matplotlib.figure.Figure]: # pragma: no cover
176
176
  """Search for critical temperature."""
@@ -18,9 +18,9 @@ def self_consistency_loop( # noqa: PLR0913
18
18
  beta: float,
19
19
  hubbard_int_orbital_basis: npt.NDArray[np.float64],
20
20
  epsilon: float,
21
+ q: npt.NDArray[np.float64],
21
22
  max_iter: int = 1000,
22
23
  delta_init: npt.NDArray[np.complex128] | None = None,
23
- q: npt.NDArray[np.float64] | None = None,
24
24
  ) -> ndarray[tuple[int, ...], dtype[complexfloating]]:
25
25
  """Self-consistently solves the gap equation for a given Hamiltonian.
26
26
 
@@ -10,7 +10,8 @@ def test_bdg_square_lattice(square_lattice_tb):
10
10
  bdg = bdg_hamiltonian(
11
11
  hamiltonian=square_lattice_tb,
12
12
  k=k,
13
- delta_orbital_basis=np.array([delta_0])
13
+ delta_orbital_basis=np.array([delta_0]),
14
+ q=np.array([0.0, 0.0, 0.0])
14
15
  )
15
16
 
16
17
  assert bdg.shape == (2, 2)
@@ -12,5 +12,6 @@ def test_scf(square_lattice_tb):
12
12
  beta=np.inf,
13
13
  hubbard_int_orbital_basis=np.array([0.0]),
14
14
  epsilon=1e-2,
15
+ q=np.array([0.0, 0.0, 0.0])
15
16
  )
16
17
  assert np.allclose(solved_gap, 0)