material
Module for classes used to represent materials and their properties
MaterialParameters(N=None, S=None, L=None, L_dot_S=None, L_tens_S=None, lambda_S=None, lambda_L=None, m_psi=None)
Class for DM-relevant material properties, such as the number of fermions, spin, orbital angular momentum, etc.
Attributes:
Name | Type | Description |
---|---|---|
N |
dict
|
Fermion numbers. |
S |
dict
|
Spin vectors. |
L |
dict
|
Orbital angular momentum vectors. |
L_dot_S |
dict
|
\(L \cdot S\) |
L_tens_S |
dict
|
Spin orbit coupling tensor \(L \otimes S\) |
lambda_S |
ArrayLike
|
spin-coefficient for magnons |
lambda_L |
ArrayLike
|
orbital angular mom.-coefficient for magnons |
m_psi |
dict
|
Dictionary of masses for different particles. |
Methods:
Name | Description |
---|---|
validate_for_phonons |
Validates that the material properties are suitable for phonon calculations. |
validate_for_magnons |
Validates that the material properties are suitable for magnon calculations. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
N |
dict
|
Fermion numbers. |
None
|
S |
dict
|
Spin vectors. |
None
|
L |
dict
|
Orbital angular momentum vectors. |
None
|
L_dot_S |
dict
|
\(L \cdot S\) |
None
|
L_tens_S |
dict
|
Spin orbit coupling tensor \(L \otimes S\) |
None
|
lambda_S |
ArrayLike
|
spin-coefficient for magnons |
None
|
lambda_L |
ArrayLike
|
orbital angular mom.-coefficient for magnons |
None
|
m_psi |
dict
|
Masses of the fermions. Defaults to NIST values. |
None
|
Source code in darkmagic/material.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|
validate_for_phonons(n_atoms)
Validates that the material properties are suitable for phonons. Namely, at least one of N, S, L, L_dot_S or L_tens_S must be defined.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_atoms |
int
|
Number of atoms in the material. |
required |
Raises:
Type | Description |
---|---|
AssertionError
|
If any of the required material properties for phonons are missing or have incorrect dimensions. |
Source code in darkmagic/material.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
|
validate_for_magnons(n_atoms)
Validates that the material properties are suitable for magnons. Namely, at least one of lambda_S and lambda_L must be defined.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_atoms |
int
|
Number of atoms in the material. |
required |
Raises:
Type | Description |
---|---|
AssertionError
|
If any of the required material properties for magnons are missing or have incorrect dimensions. |
Source code in darkmagic/material.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
|
Material(name, properties, structure, m_atoms)
Bases: ABC
Represents a generic material with its structural and atomic properties.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the material. |
properties |
MaterialProperties
|
The properties of the material. |
real_frac_to_cart |
ndarray
|
The transformation matrix from fractional to Cartesian coordinates (units 1/eV), in real space. |
real_cart_to_frac |
ndarray
|
The transformation matrix from Cartesian (units 1/eV) to fractional coordinates, in real space. |
recip_frac_to_cart |
ndarray
|
The transformation matrix from fractional to Cartesian coordinates (units eV), in k-space. |
recip_cart_to_frac |
ndarray
|
The transformation matrix from Cartesian (units eV) to fractional coordinates, in k-space. |
m_atoms |
ArrayLike
|
an array of atomic masses, in eV. |
m_cell |
ndarray
|
The total mass of the atoms in the material, in eV. |
xj |
ndarray
|
The Cartesian coordinates (units 1/eV) of the atoms in the material. |
structure |
Structure
|
the crystal structure |
n_atoms |
int
|
The number of atoms in the material. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the material. |
required |
properties |
MaterialProperties
|
The properties of the material. |
required |
structure |
Structure
|
The structure of the material. |
required |
m_atoms |
ArrayLike
|
atomic masses in eV. |
required |
Source code in darkmagic/material.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
|
max_dE: float
abstractmethod
property
Abstract method for estimating the maximum energy deposition
q_cut: float
property
Abstract method for estimating a cutoff for the momentum transfer
get_eig(grid, with_eigenvectors=True)
abstractmethod
Abstract method for computing eigenvalues and eigenvectors
Source code in darkmagic/material.py
219 220 221 222 223 224 225 226 |
|
PhononMaterial(name, properties, phonopy_yaml_path)
Bases: Material
A class for materials with phonons.
Attributes:
Name | Type | Description |
---|---|---|
phonopy_file |
Phonopy
|
The Phonopy object for the material's phonons |
n_modes |
int
|
The number of phonon modes in the material. |
born |
ndarray
|
The born effective charges |
epsilon |
ndarray
|
The dielectric tensor |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the material. |
required |
properties |
MaterialProperties
|
The properties of the material. |
required |
phonopy_yaml_path |
str
|
The path to the Phonopy YAML file. |
required |
Source code in darkmagic/material.py
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 |
|
max_dE: float
property
Returns omega_ph_max = max(omega_ph) if there are optical modes, otherwise returns the average over the entire Brillouin zone. The quantities are obviously not the same but should be the same order. See theoretical framework paper, paragraph in middle of page 24 (of published version).
TODO: clarify this
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
the maximum energy deposition |
q_cut: float
property
The Debye-Waller factor suppresses the rate at larger q beyond q ~ np.sqrt(m_atom * omega_ph). This method calculates an estimate for the cutoff value of q.
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The cutoff value of q. |
get_eig(grid, with_eigenvectors=True)
Calculates the phonon frequencies and eigenvectors for the given k-points.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
grid |
SphericalGrid
|
The grid object with the k-points. |
required |
with_eigenvectors |
bool
|
Whether to compute the eigenvectors. Defaults to True. |
True
|
Returns:
Type | Description |
---|---|
Tuple[ndarray, ndarray]
|
A tuple containing the phonon frequencies and eigenvectors.
where n_k is the number of k-points, n_modes is the number of modes, n_atoms is the number of atoms, and the last index is for the x, y, z components of the eigenvectors. |
Source code in darkmagic/material.py
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 |
|
get_W_tensor(grid)
Computes the W tensor for the given Monkhorst-Pack grid. The W tensor for atom \(j\) is given by: $$ \mathbf{W}j = \frac{\Omega}{4 m_j} \sum\nu \int_\text{1BZ} \frac{d^3k}{(2\pi)^3} \frac{\epsilon_{\nu j \bm{k}} \otimes \epsilon_{\nu j \bm{k}}^*}{\omega_{\nu \bm{k}}} $$
The Debye-Waller factor can be computed from the W tensor as: $$ W_j(\bm{q}) = \bm{q} \cdot (\mathbf{W}_j \bm{q}) $$
Parameters:
Name | Type | Description | Default |
---|---|---|---|
grid |
MonkhorstPackGrid
|
The Monkhorst-Pack grid. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: The W tensor. |
Source code in darkmagic/material.py
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 |
|
MagnonMaterial(name, properties, hamiltonian, m_cell, nodmi=False, noaniso=False)
Bases: Material
A class for materials with magnons
Attributes:
Name | Type | Description |
---|---|---|
hamiltonian |
SpinHamiltonian
|
The spin Hamiltonian of the material. |
n_modes |
int
|
The number of magnon modes. |
dispersion |
MagnonDispersion
|
The magnon dispersion. |
In the current implementation, the hamiltonian only contains the magnetic atoms and their interactions. So m_cell needs to be specified separately
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the material. |
required |
properties |
MaterialParameters
|
The properties of the material. |
required |
hamiltonian |
SpinHamiltonian
|
The spin Hamiltonian |
required |
m_cell |
float
|
the total mass of all ions in the cell |
required |
nodmi |
bool
|
Whether to include DM interactions. |
False
|
noaniso |
bool
|
Whether to include anisotropic exchange. |
False
|
Source code in darkmagic/material.py
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 |
|
max_dE: float
property
TODO: this needs improvement
Returns the maximum dE possible for the material. For magnons, we estimate this as roughly 3 times the highest magnon frequency at the Brillouin zone (BZ) boundary. If there are no gapped modes at the gamma point, the maximum dE will be 0.
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The maximum dE value. |
Notes
This calculation should be an average over the Brillouin zone (BZ).
q_cut: float
property
For magnons there is no q_cut
, so we just set this to a very large number.
Returns:
Name | Type | Description |
---|---|---|
q_cut |
float
|
a very large number. |
get_eig(grid)
Computes the magnon eigenvalues and eigenvectors (polarization vectors) for a list of k-points.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
k |
ArrayLike
|
The k-point in fractional coordinates. |
required |
Returns:
Source code in darkmagic/material.py
492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 |
|