quant-met 0.0.8__py3-none-any.whl → 0.0.9__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.
- quant_met/cli/scf.py +5 -7
- quant_met/geometry/base_lattice.py +18 -4
- quant_met/geometry/graphene.py +10 -2
- quant_met/geometry/square.py +11 -3
- quant_met/mean_field/_utils.py +0 -11
- quant_met/mean_field/hamiltonians/__init__.py +3 -6
- quant_met/mean_field/hamiltonians/base_hamiltonian.py +52 -119
- quant_met/mean_field/hamiltonians/dressed_graphene.py +20 -75
- quant_met/mean_field/hamiltonians/graphene.py +13 -60
- quant_met/mean_field/hamiltonians/one_band_tight_binding.py +14 -62
- quant_met/mean_field/hamiltonians/three_band_tight_binding.py +116 -0
- quant_met/mean_field/hamiltonians/two_band_tight_binding.py +107 -0
- quant_met/mean_field/quantum_metric.py +3 -2
- quant_met/mean_field/self_consistency.py +8 -17
- quant_met/mean_field/superfluid_weight.py +6 -3
- quant_met/parameters/__init__.py +17 -2
- quant_met/parameters/hamiltonians.py +115 -15
- quant_met/parameters/main.py +0 -3
- {quant_met-0.0.8.dist-info → quant_met-0.0.9.dist-info}/METADATA +1 -1
- quant_met-0.0.9.dist-info/RECORD +33 -0
- quant_met-0.0.8.dist-info/RECORD +0 -31
- {quant_met-0.0.8.dist-info → quant_met-0.0.9.dist-info}/LICENSE.txt +0 -0
- {quant_met-0.0.8.dist-info → quant_met-0.0.9.dist-info}/LICENSES/MIT.txt +0 -0
- {quant_met-0.0.8.dist-info → quant_met-0.0.9.dist-info}/WHEEL +0 -0
- {quant_met-0.0.8.dist-info → quant_met-0.0.9.dist-info}/entry_points.txt +0 -0
@@ -4,44 +4,144 @@
|
|
4
4
|
|
5
5
|
"""Pydantic models to hold parameters for Hamiltonians."""
|
6
6
|
|
7
|
-
from typing import Literal
|
7
|
+
from typing import Literal, TypeVar
|
8
8
|
|
9
9
|
import numpy as np
|
10
10
|
from numpydantic import NDArray, Shape
|
11
|
-
from pydantic import BaseModel
|
11
|
+
from pydantic import BaseModel, Field, field_validator
|
12
|
+
from pydantic_core.core_schema import ValidationInfo
|
12
13
|
|
14
|
+
GenericParameters = TypeVar("GenericParameters", bound="HamiltonianParameters")
|
13
15
|
|
14
|
-
|
16
|
+
|
17
|
+
def check_positive_values(value: float, info: ValidationInfo) -> float:
|
18
|
+
"""Check for positive values."""
|
19
|
+
if value < 0:
|
20
|
+
msg = f"{info.field_name} must be positive"
|
21
|
+
raise ValueError(msg)
|
22
|
+
return value
|
23
|
+
|
24
|
+
|
25
|
+
def validate_float(value: float, info: ValidationInfo) -> float:
|
26
|
+
"""Check for valid floats."""
|
27
|
+
if np.isinf(value):
|
28
|
+
msg = f"{info.field_name} must not be Infinity"
|
29
|
+
raise ValueError(msg)
|
30
|
+
if np.isnan(value):
|
31
|
+
msg = f"{info.field_name} must not be NaN"
|
32
|
+
raise ValueError(msg)
|
33
|
+
return value
|
34
|
+
|
35
|
+
|
36
|
+
class HamiltonianParameters(BaseModel):
|
37
|
+
"""Base class for Hamiltonian parameters."""
|
38
|
+
|
39
|
+
name: str
|
40
|
+
beta: float | None = Field(default=None, description="Inverse temperature")
|
41
|
+
q: NDArray[Shape["2"], int | float] | None = Field(
|
42
|
+
default=None, description="Momentum of Cooper pairs"
|
43
|
+
)
|
44
|
+
hubbard_int_orbital_basis: NDArray = Field(
|
45
|
+
..., description="Hubbard interaction in orbital basis"
|
46
|
+
)
|
47
|
+
|
48
|
+
|
49
|
+
class DressedGrapheneParameters(HamiltonianParameters):
|
15
50
|
"""Parameters for the dressed Graphene model."""
|
16
51
|
|
17
52
|
name: Literal["DressedGraphene"] = "DressedGraphene"
|
18
|
-
hopping_gr: float
|
19
|
-
hopping_x: float
|
20
|
-
hopping_x_gr_a: float
|
21
|
-
lattice_constant: float
|
22
|
-
chemical_potential: float
|
23
|
-
|
24
|
-
|
25
|
-
|
53
|
+
hopping_gr: float = Field(..., description="Hopping in graphene")
|
54
|
+
hopping_x: float = Field(..., description="Hopping in impurity")
|
55
|
+
hopping_x_gr_a: float = Field(..., description="Hybridization")
|
56
|
+
lattice_constant: float = Field(..., description="Lattice constant")
|
57
|
+
chemical_potential: float = Field(..., description="Chemical potential")
|
58
|
+
hubbard_int_orbital_basis: NDArray[Shape["3"], np.float64] = Field(
|
59
|
+
..., description="Hubbard interaction in orbital basis"
|
60
|
+
)
|
61
|
+
delta: NDArray[Shape["3"], np.complex64] | None = Field(
|
62
|
+
default=None, description="Initial value for gaps in orbital space"
|
63
|
+
)
|
64
|
+
|
65
|
+
_check_positive_values = field_validator(
|
66
|
+
"hopping_gr", "hopping_x", "hopping_x_gr_a", "lattice_constant"
|
67
|
+
)(check_positive_values)
|
68
|
+
|
69
|
+
_check_valid_floats = field_validator(
|
70
|
+
"hopping_gr", "hopping_x", "hopping_x_gr_a", "lattice_constant", "chemical_potential"
|
71
|
+
)(validate_float)
|
26
72
|
|
27
73
|
|
28
|
-
class GrapheneParameters(
|
74
|
+
class GrapheneParameters(HamiltonianParameters):
|
29
75
|
"""Parameters for Graphene model."""
|
30
76
|
|
31
77
|
name: Literal["Graphene"] = "Graphene"
|
32
78
|
hopping: float
|
33
79
|
lattice_constant: float
|
34
80
|
chemical_potential: float
|
35
|
-
|
81
|
+
hubbard_int_orbital_basis: NDArray[Shape["2"], np.float64] = Field(
|
82
|
+
..., description="Hubbard interaction in orbital basis"
|
83
|
+
)
|
36
84
|
delta: NDArray[Shape["2"], np.complex64] | None = None
|
37
85
|
|
86
|
+
_check_positive_values = field_validator("hopping", "lattice_constant")(check_positive_values)
|
87
|
+
|
88
|
+
_check_valid_floats = field_validator("hopping", "lattice_constant", "chemical_potential")(
|
89
|
+
validate_float
|
90
|
+
)
|
91
|
+
|
38
92
|
|
39
|
-
class OneBandParameters(
|
93
|
+
class OneBandParameters(HamiltonianParameters):
|
40
94
|
"""Parameters for Graphene model."""
|
41
95
|
|
42
96
|
name: Literal["OneBand"] = "OneBand"
|
43
97
|
hopping: float
|
44
98
|
lattice_constant: float
|
45
99
|
chemical_potential: float
|
46
|
-
|
100
|
+
hubbard_int_orbital_basis: NDArray[Shape["1"], np.float64] = Field(
|
101
|
+
..., description="Hubbard interaction in orbital basis"
|
102
|
+
)
|
47
103
|
delta: NDArray[Shape["1"], np.complex64] | None = None
|
104
|
+
|
105
|
+
_check_positive_values = field_validator("hopping", "lattice_constant")(check_positive_values)
|
106
|
+
|
107
|
+
_check_valid_floats = field_validator("hopping", "lattice_constant", "chemical_potential")(
|
108
|
+
validate_float
|
109
|
+
)
|
110
|
+
|
111
|
+
|
112
|
+
class TwoBandParameters(HamiltonianParameters):
|
113
|
+
"""Parameters for Graphene model."""
|
114
|
+
|
115
|
+
name: Literal["TwoBand"] = "TwoBand"
|
116
|
+
hopping: float
|
117
|
+
lattice_constant: float
|
118
|
+
chemical_potential: float
|
119
|
+
hubbard_int_orbital_basis: NDArray[Shape["2"], np.float64] = Field(
|
120
|
+
..., description="Hubbard interaction in orbital basis"
|
121
|
+
)
|
122
|
+
delta: NDArray[Shape["2"], np.complex64] | None = None
|
123
|
+
|
124
|
+
_check_positive_values = field_validator("hopping", "lattice_constant")(check_positive_values)
|
125
|
+
|
126
|
+
_check_valid_floats = field_validator("hopping", "lattice_constant", "chemical_potential")(
|
127
|
+
validate_float
|
128
|
+
)
|
129
|
+
|
130
|
+
|
131
|
+
class ThreeBandParameters(HamiltonianParameters):
|
132
|
+
"""Parameters for Graphene model."""
|
133
|
+
|
134
|
+
name: Literal["ThreeBand"] = "ThreeBand"
|
135
|
+
hopping: float
|
136
|
+
lattice_constant: float
|
137
|
+
chemical_potential: float
|
138
|
+
hubbard_int_orbital_basis: NDArray[Shape["3"], np.float64] = Field(
|
139
|
+
..., description="Hubbard interaction in orbital basis"
|
140
|
+
)
|
141
|
+
delta: NDArray[Shape["3"], np.complex64] | None = None
|
142
|
+
|
143
|
+
_check_positive_values = field_validator("hopping", "lattice_constant")(check_positive_values)
|
144
|
+
|
145
|
+
_check_valid_floats = field_validator("hopping", "lattice_constant", "chemical_potential")(
|
146
|
+
validate_float
|
147
|
+
)
|
quant_met/parameters/main.py
CHANGED
@@ -6,7 +6,6 @@
|
|
6
6
|
|
7
7
|
import pathlib
|
8
8
|
|
9
|
-
from numpydantic import NDArray, Shape
|
10
9
|
from pydantic import BaseModel, Field
|
11
10
|
|
12
11
|
from .hamiltonians import DressedGrapheneParameters, GrapheneParameters, OneBandParameters
|
@@ -19,8 +18,6 @@ class Control(BaseModel):
|
|
19
18
|
prefix: str
|
20
19
|
outdir: pathlib.Path
|
21
20
|
conv_treshold: float
|
22
|
-
beta: float
|
23
|
-
q: NDArray[Shape["2"], int | float] | None = None
|
24
21
|
|
25
22
|
|
26
23
|
class KPoints(BaseModel):
|
@@ -0,0 +1,33 @@
|
|
1
|
+
quant_met/__init__.py,sha256=ZO1UFz1awUYTI7B9ZkBwucvDz7GMGXnLLUGnEwLBhkc,155
|
2
|
+
quant_met/cli/__init__.py,sha256=If5Jdi7mG-5PbIyjQGxnt9o2bsY5VyE3qtdcO5yTGnQ,321
|
3
|
+
quant_met/cli/main.py,sha256=EZTRRTfrN3z-srgbG2BoDg64iYBjzZLuuMtrxTdZU8s,698
|
4
|
+
quant_met/cli/scf.py,sha256=sc26jlsslZkVOw8Y88Fgm8gR6DZ99VhtNePqgsd8Ac4,1434
|
5
|
+
quant_met/geometry/__init__.py,sha256=uCLEDBrYuMUkEgJmPnLAvR2WlmvoM9X9_cV_Q2zMzoA,620
|
6
|
+
quant_met/geometry/base_lattice.py,sha256=dUBk3167cppy5nUNSEbXq57rwgbVnIen20jC_vrhomA,2642
|
7
|
+
quant_met/geometry/bz_path.py,sha256=q_eNhKYjhKLeFNjio8BdKVsseO6slQKlwKKSQQYTVJQ,2497
|
8
|
+
quant_met/geometry/graphene.py,sha256=AIKI2ice7LiKk5LHS27w97FkUds0UFV7EVNML3W5D28,1623
|
9
|
+
quant_met/geometry/square.py,sha256=lAEJ2R_2VBBPI_Bc-x-KhPE5r8AGoY1RgAx8GdoqdNY,1561
|
10
|
+
quant_met/mean_field/__init__.py,sha256=yH_UovKDaP5c06cb1uWPtvIO2WQ76pi6ZTsNBzE8oso,793
|
11
|
+
quant_met/mean_field/_utils.py,sha256=7hr0DDSdIqjft5Jjluvbw_HGoNLWgYJTxyuPJJvhBnc,356
|
12
|
+
quant_met/mean_field/hamiltonians/__init__.py,sha256=bThuXC2jHzyD6rG0CAII8huD2kCRnc_Dp-Cl7g3MDxg,741
|
13
|
+
quant_met/mean_field/hamiltonians/base_hamiltonian.py,sha256=51uargS4B2MNAa-GFxuQ_hzZjIOhlfjBFwyeDMWs8gk,12653
|
14
|
+
quant_met/mean_field/hamiltonians/dressed_graphene.py,sha256=arOfEFegblNTckow1_Xz-sf7xPNahcasjv_kGo-n4PE,4744
|
15
|
+
quant_met/mean_field/hamiltonians/graphene.py,sha256=IDQVWDzGDgIliyNGPP-c-tsfEeevhdrbD1I4fZKHQJw,3972
|
16
|
+
quant_met/mean_field/hamiltonians/one_band_tight_binding.py,sha256=Yj_AX6llD-It_VupY6tOgwUfpypt4S5Hw4yGNpz1GXE,3166
|
17
|
+
quant_met/mean_field/hamiltonians/three_band_tight_binding.py,sha256=4-7ryAM0vYxuLX65Y2IPGv6pTbx7NaY_l-G9wgdDjHI,3967
|
18
|
+
quant_met/mean_field/hamiltonians/two_band_tight_binding.py,sha256=kTqZ5VWGleHhB5leCF22TdnD9yS7T9LKmhs7OqdXe0Q,3539
|
19
|
+
quant_met/mean_field/quantum_metric.py,sha256=dBHh5OW_noTfhNW_kAkjuvfHiMdWmoPPwCDEdR05_2s,3992
|
20
|
+
quant_met/mean_field/self_consistency.py,sha256=riyrqjZZSg9L1Ryu_qz-fT3DY8mU5xUyvpmgK8XQgGo,1203
|
21
|
+
quant_met/mean_field/superfluid_weight.py,sha256=c7fNcq7JQQBpKt0R5JjkGlO-pAoznblPkA__5rNCyVw,4118
|
22
|
+
quant_met/parameters/__init__.py,sha256=t2bjPDW7pVYKP8nLG4mnFEgKiype6xbt8nK4YnKh9UQ,736
|
23
|
+
quant_met/parameters/hamiltonians.py,sha256=JcXXwR31FUSMcqCZmix8oGC4iy1IqregiFtD45Uht-4,5087
|
24
|
+
quant_met/parameters/main.py,sha256=_pBm9tvlOPjoZ-2ECVMegyCaSXkfD6IwdhHk5s9oRKw,790
|
25
|
+
quant_met/plotting/__init__.py,sha256=s-DS22impzozKiS7p-v3yCmeccDQfXmBbtPiYMKwH0Y,620
|
26
|
+
quant_met/plotting/plotting.py,sha256=_SqL8GrDqlBtccHnUWpZPqdSJy0Yd_4dhFdUOxOzPpY,7447
|
27
|
+
quant_met/utils.py,sha256=JG_tShSL1JIi-Fn-N6mVD6J0sl7Egf-zuHnOSEKu7VA,1666
|
28
|
+
quant_met-0.0.9.dist-info/LICENSE.txt,sha256=QO_duPQihSJlaxSLxPAXo52X3esROP5wBkhxqBd1Z4E,1104
|
29
|
+
quant_met-0.0.9.dist-info/LICENSES/MIT.txt,sha256=QO_duPQihSJlaxSLxPAXo52X3esROP5wBkhxqBd1Z4E,1104
|
30
|
+
quant_met-0.0.9.dist-info/METADATA,sha256=mY2CC8l98QgEPyGx4KrRUfQ7kqDtbfqI6qCTYnnHhew,2953
|
31
|
+
quant_met-0.0.9.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
32
|
+
quant_met-0.0.9.dist-info/entry_points.txt,sha256=fuVnEk5wiqPMEhn-Cc7q0Hdk2s_OniOn0zfdFPicH4Y,47
|
33
|
+
quant_met-0.0.9.dist-info/RECORD,,
|
quant_met-0.0.8.dist-info/RECORD
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
quant_met/__init__.py,sha256=ZO1UFz1awUYTI7B9ZkBwucvDz7GMGXnLLUGnEwLBhkc,155
|
2
|
-
quant_met/cli/__init__.py,sha256=If5Jdi7mG-5PbIyjQGxnt9o2bsY5VyE3qtdcO5yTGnQ,321
|
3
|
-
quant_met/cli/main.py,sha256=EZTRRTfrN3z-srgbG2BoDg64iYBjzZLuuMtrxTdZU8s,698
|
4
|
-
quant_met/cli/scf.py,sha256=x9qxjQizXAKH7217dBuHTlA26eGenzcC2LDpN1q7030,1435
|
5
|
-
quant_met/geometry/__init__.py,sha256=uCLEDBrYuMUkEgJmPnLAvR2WlmvoM9X9_cV_Q2zMzoA,620
|
6
|
-
quant_met/geometry/base_lattice.py,sha256=QVHuZVy6bOvBSITY_mKhr7hYW1jHJ5UAm3sMCFClYZ0,2276
|
7
|
-
quant_met/geometry/bz_path.py,sha256=q_eNhKYjhKLeFNjio8BdKVsseO6slQKlwKKSQQYTVJQ,2497
|
8
|
-
quant_met/geometry/graphene.py,sha256=86C1LiYFunoSGSS1_A79dPq24FiiOxpHvOLUVrdRq_E,1271
|
9
|
-
quant_met/geometry/square.py,sha256=1fSrHab07uB6ildNzlbTwINJvPa5C2Az0B0uuOVJmMc,1216
|
10
|
-
quant_met/mean_field/__init__.py,sha256=yH_UovKDaP5c06cb1uWPtvIO2WQ76pi6ZTsNBzE8oso,793
|
11
|
-
quant_met/mean_field/_utils.py,sha256=plkx6eYjyYV3CT3BWwlulqW7L-Q0t1TzZTLR4k7u0dg,666
|
12
|
-
quant_met/mean_field/hamiltonians/__init__.py,sha256=FcqhV5fG_gzngVuiVfBucripdbNTzOxPRafu7sZ4ueA,644
|
13
|
-
quant_met/mean_field/hamiltonians/base_hamiltonian.py,sha256=fL1dl1ZX3I_4gzARiQl5o2eCTIr-udRA23qZo4VWq0k,13622
|
14
|
-
quant_met/mean_field/hamiltonians/dressed_graphene.py,sha256=zzHRVmp8749I2ll5N-wjks8l5dJLdtmhWR7smR7ezM0,6542
|
15
|
-
quant_met/mean_field/hamiltonians/graphene.py,sha256=Zg_S9xTMYi_7v_6PBK7NUdiwgmyqyCPElUfezuiozm0,5611
|
16
|
-
quant_met/mean_field/hamiltonians/one_band_tight_binding.py,sha256=kBYqthKUPby754PhOwf0mzHLTHNVbdKZbtJhvp2yc3E,4766
|
17
|
-
quant_met/mean_field/quantum_metric.py,sha256=5FC3NU_ObbHlUUZMCAP1DyZuyifgnEr3s2cSH6cA8-8,3903
|
18
|
-
quant_met/mean_field/self_consistency.py,sha256=xkZIWkOopekhDufJnSGK6ARsro6XaIuVhhrnJmb6sk8,1291
|
19
|
-
quant_met/mean_field/superfluid_weight.py,sha256=m_x2uVYcEVdbItwEV3-Ml80Qad7X-YWLgb38fJKLJsY,4004
|
20
|
-
quant_met/parameters/__init__.py,sha256=DvzEtTAnHcRcJufZV7bwYGZUeA-0Q2B8N9syGA9uNRM,552
|
21
|
-
quant_met/parameters/hamiltonians.py,sha256=Q5uGTzxM8kIdUnRuIpEJNPmSHF27Zj7LBV3kgKd5dP4,1213
|
22
|
-
quant_met/parameters/main.py,sha256=yrDME_KfDZ_9xf3ofTt7V8kw_8qbgD9EfVlxLcymcNE,899
|
23
|
-
quant_met/plotting/__init__.py,sha256=s-DS22impzozKiS7p-v3yCmeccDQfXmBbtPiYMKwH0Y,620
|
24
|
-
quant_met/plotting/plotting.py,sha256=_SqL8GrDqlBtccHnUWpZPqdSJy0Yd_4dhFdUOxOzPpY,7447
|
25
|
-
quant_met/utils.py,sha256=JG_tShSL1JIi-Fn-N6mVD6J0sl7Egf-zuHnOSEKu7VA,1666
|
26
|
-
quant_met-0.0.8.dist-info/LICENSE.txt,sha256=QO_duPQihSJlaxSLxPAXo52X3esROP5wBkhxqBd1Z4E,1104
|
27
|
-
quant_met-0.0.8.dist-info/LICENSES/MIT.txt,sha256=QO_duPQihSJlaxSLxPAXo52X3esROP5wBkhxqBd1Z4E,1104
|
28
|
-
quant_met-0.0.8.dist-info/METADATA,sha256=vh99nVcyAhUECV32kkXxfDjne2LvBufs6ekW60m8pYs,2953
|
29
|
-
quant_met-0.0.8.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
30
|
-
quant_met-0.0.8.dist-info/entry_points.txt,sha256=fuVnEk5wiqPMEhn-Cc7q0Hdk2s_OniOn0zfdFPicH4Y,47
|
31
|
-
quant_met-0.0.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|