numerics
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
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|
SphericalGrid(m_chi, v_e, use_q_cut, N_grid, material)
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
66 67 68 69 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 |
|
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 density-weighted Fermi grid. 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
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 |
|
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
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 |
|
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
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
|
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
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 |
|
get_DWF_grid()
Returns the density-weighted Fermi grid object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
material |
Material
|
The material object. |
required |
Returns:
Name | Type | Description |
---|---|---|
MonkhorstPackGrid |
MonkhorstPackGrid
|
The density-weighted Fermi grid object. |
Source code in darkmagic/numerics.py
331 332 333 334 335 336 337 338 339 340 341 |
|