numerics
Module with classes for numerics (grids, etc.)
MonkhorstPackGrid(N_grid, shift=True)
A class representing a Monkhorst-Pack grid for Brillouin zone sampling.
Attributes:
Name | Type | Description |
---|---|---|
k_frac |
ndarray
|
The fractional coordinates of the k vectors. |
weights |
ndarray
|
The weights of the k vectors. |
N_grid (ArrayLike): The number of grid points along each reciprocal lattice vector. shift (bool): Whether to shift the grid. Defaults to a shifted grid to avoid singularities in DWF.
Source code in darkmagic/numerics.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
SphericalGrid(m_chi, v_e, use_q_cut, N_grid, material, use_special_mesh=False)
Represents a spherical grid used for numerical calculations in DarkMAGIC.
Attributes:
Name | Type | Description |
---|---|---|
nq |
int
|
The number of q points. |
q_max |
float
|
The maximum value of the q vector (eV). |
q_cart |
ndarray
|
The Cartesian coordinates of the q vectors (eV). |
q_frac |
ndarray
|
The fractional coordinates of the q vectors. |
q_norm |
ndarray
|
The norms of the q vectors (eV). |
q_hat |
ndarray
|
The unit vectors of the q vectors. |
G_cart |
ndarray
|
The Cartesian coordinates of the G vectors (eV). |
G_frac |
ndarray
|
The fractional coordinates of the G vectors. |
jacobian |
ndarray
|
The Jacobian determinant for the spherical grid. |
k_frac |
ndarray
|
The fractional coordinates of the k vectors. |
k_cart |
ndarray
|
The Cartesian coordinates of the k vectors. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
m_chi |
float
|
The mass of the dark matter particle. |
required |
v_e |
ArrayLike
|
The velocity of the Earth. |
required |
use_q_cut |
bool
|
Whether to use the q_cut value. |
required |
N_grid |
ArrayLike
|
The number of grid points (radial, azimuthal, polar) |
required |
material |
Material
|
A Material object containing the material properties. |
required |
Source code in darkmagic/numerics.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
|
Numerics(N_grid=None, N_DWF_grid=None, bin_width=0.001, use_q_cut=True, use_special_mesh=False, threshold=0, power_abc=None)
A class that represents the numerical parameters for DarkMAGIC calculations.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
N_grid |
ArrayLike
|
The number of grid points in each dimension. Defaults to [20, 10, 10]. |
None
|
power_abc |
ArrayLike
|
The power of each dimension in the grid. Defaults to [2, 1, 1]. |
None
|
N_DWF_grid |
ArrayLike
|
The number of grid points in each dimension for the Monkhorst-Pack grid used to compute the Debye-Waller factor. Defaults to [20, 20, 20]. |
None
|
bin_width |
float
|
The width of the bin. Defaults to 1e-3 (1 meV). |
0.001
|
use_q_cut |
bool
|
Whether to use a cutoff in momentum space. Defaults to True. |
True
|
use_special_mesh |
bool
|
Whether to use a special mesh for the grid. Defaults to False. |
False
|
Attributes:
Name | Type | Description |
---|---|---|
N_grid |
ndarray
|
The number of grid points in the spherical grid used to sample the momentum transfer (radial, azimuthal, polar). |
power_abc |
ndarray
|
The power of each dimension in the grid (currently unsued) |
N_DWF_grid |
ndarray
|
The size of the Monkhorst-Pack grid used to compute the Debye-Waller factor. |
bin_width |
float
|
The width of the energy bin. Rebinning to larger bins is possible in postprocessing. |
use_q_cut |
bool
|
Whether to use a cutoff for the momentum transfer from DM. If False, the cutoff is set to the maximum possible value \(2 m_{\chi} (v_{\text{esc}} + v_{\text{e}})\). |
use_special_mesh |
bool
|
Whether to use a special mesh for the spherical grid (currently unused) |
Methods:
Name | Description |
---|---|
get_grid |
float, v_e: ArrayLike, material: Material) -> SphericalGrid: Returns the spherical grid for the given dark matter mass, Earth velocity, and material. |
get_DWF_grid |
Returns the Monkhorst-Pack grid for computing the Debye-Waller factor. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
N_grid |
ndarray
|
The number of grid points in the spherical grid used to sample the momentum transfer (radial, azimuthal, polar). |
None
|
power_abc |
ndarray
|
The power of each dimension in the grid (currently unsued) |
None
|
N_DWF_grid |
ndarray
|
The size of the Monkhorst-Pack grid used to compute the Debye-Waller factor. |
None
|
bin_width |
float
|
The width of the energy bin. Rebinning to larger bins is possible in postprocessing. |
0.001
|
use_q_cut |
bool
|
Whether to use a cutoff for the momentum transfer from DM. If False, the cutoff is set to the maximum possible value \(2 m_{\chi} (v_{\text{esc}} + v_{\text{e}})\). |
True
|
use_special_mesh |
bool
|
Whether to use a special mesh for the spherical grid (currently unused) |
False
|
threshold |
float
|
unused, DarkMAGIC does not impose any thresholds during the actual calculation. Maintained for backwards compatibility. |
0
|
Source code in darkmagic/numerics.py
292 293 294 295 296 297 298 299 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 |
|
from_dict(d)
classmethod
Create a Numerics object from a dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
d |
dict
|
The dictionary containing the numerical parameters. |
required |
Returns:
Name | Type | Description |
---|---|---|
Numerics |
The Numerics object. |
Source code in darkmagic/numerics.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 |
|
to_dict()
Convert the Numerics object to a dictionary.
Returns:
Name | Type | Description |
---|---|---|
dict |
The dictionary containing the numerical parameters. |
Source code in darkmagic/numerics.py
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 |
|
get_grid(m_chi, v_e, material)
Returns the spherical grid object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
m_chi |
float
|
The mass of the dark matter particle. |
required |
v_e |
ArrayLike
|
The velocity of the Earth. |
required |
material |
Material
|
The material object. |
required |
Returns:
Name | Type | Description |
---|---|---|
SphericalGrid |
SphericalGrid
|
The spherical grid object. |
Source code in darkmagic/numerics.py
366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
|
get_DWF_grid()
Returns the Monkhorst-Pack grid object for computing the Debye-Waller factor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
material |
Material
|
The material object. |
required |
Returns:
Name | Type | Description |
---|---|---|
MonkhorstPackGrid |
MonkhorstPackGrid
|
The Monkhorst-Pack grid object for computing DWF. |
Source code in darkmagic/numerics.py
384 385 386 387 388 389 390 391 392 393 394 |
|