kups.potential.classical.ewald.parameters
¶
Ewald parameter estimation and reciprocal lattice preparation before tracing.
EwaldParameterEstimates
¶
Estimated optimal Ewald parameters for given accuracy.
Source code in src/kups/potential/classical/ewald/parameters.py
EwaldParameters
¶
Per-system cutoffs and reciprocal shifts prepared before evaluation.
reciprocal_shift_bound always stores three axis bounds. (0, 0, 0)
selects explicit, sphere-filtered shifts padded for batching; other bounds
describe a complete grid. Rebuild parameters and the structure-factor cache
when changing the cell or cutoff.
Source code in src/kups/potential/classical/ewald/parameters.py
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 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 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |
from_cutoffs(cell, alpha, cutoff, k_max, *, compact=None, reciprocal_particle_chunk_size=None, reciprocal_k_chunk_size=_DEFAULT_RECIPROCAL_K_CHUNK)
classmethod
¶
Prepare reciprocal shifts once from supplied physical cutoffs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cell
|
Table[SystemId, HasCell[Periodic3D]]
|
System table with periodic cells. |
required |
alpha
|
Table[SystemId, Array]
|
Screening parameters in 1/Å. |
required |
cutoff
|
Table[SystemId, Array]
|
Real-space cutoffs in Å. |
required |
k_max
|
Table[SystemId, Array]
|
Reciprocal cutoffs in 1/Å. |
required |
compact
|
bool | None
|
Filter the grid; defaults to False on CPU and True elsewhere. |
None
|
reciprocal_particle_chunk_size
|
int | None
|
Maximum particles per response tile; defaults to 8192 on GPU and 1024 elsewhere. |
None
|
reciprocal_k_chunk_size
|
int
|
Maximum k-vectors per tile. |
_DEFAULT_RECIPROCAL_K_CHUNK
|
Returns:
| Type | Description |
|---|---|
EwaldParameters
|
Parameters with stored integer shifts and reciprocal cutoffs. |
Source code in src/kups/potential/classical/ewald/parameters.py
make(charges, cell, epsilon_total=1e-08, real_cutoff=None, *, reciprocal_particle_chunk_size=None, reciprocal_k_chunk_size=_DEFAULT_RECIPROCAL_K_CHUNK)
classmethod
¶
Estimate each system's parameters and prepare its reciprocal shifts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
charges
|
Table[ParticleId, IsEwaldPointData]
|
Particle table with charges and system assignments. |
required |
cell
|
Table[SystemId, HasCell[Periodic3D]]
|
System table with periodic cells. |
required |
epsilon_total
|
float
|
Target combined real-space and reciprocal-space error. |
1e-08
|
real_cutoff
|
float | None
|
Optional fixed real-space cutoff in Å. |
None
|
reciprocal_particle_chunk_size
|
int | None
|
Maximum particles per response tile; defaults to 8192 on GPU and 1024 elsewhere. |
None
|
reciprocal_k_chunk_size
|
int
|
Maximum explicit k-vectors per tile; also sets the grid workspace budget. |
_DEFAULT_RECIPROCAL_K_CHUNK
|
Returns:
| Type | Description |
|---|---|
EwaldParameters
|
Ewald parameters with stored integer shifts and reciprocal cutoffs. |
Source code in src/kups/potential/classical/ewald/parameters.py
IsEwaldPointData
¶
Bases: HasCharges, NeighborListPoints, Protocol
Particle data required by Ewald: charges, positions, system/inclusion/exclusion indices.
Source code in src/kups/potential/classical/ewald/parameters.py
estimate_ewald_parameters(charges, cell, /, real_cutoff=None, alpha=None, epsilon_total=1e-08)
¶
Estimate cutoffs and screening for one system before JIT compilation.
Split epsilon_total equally between real and reciprocal error targets.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
charges
|
Array
|
Charges in e for one system, shaped |
required |
cell
|
Cell[AnyPeriodicity]
|
Single simulation cell. |
required |
real_cutoff
|
float | None
|
Optional fixed real-space cutoff in Å; otherwise optimized. |
None
|
alpha
|
float | None
|
Optional screening parameter in 1/Å; ignored with a fixed real cutoff. |
None
|
epsilon_total
|
float
|
Target combined real-space and reciprocal-space error. |
1e-08
|
Returns:
| Type | Description |
|---|---|
EwaldParameterEstimates
|
Screening, cutoffs and estimated errors. |
Source code in src/kups/potential/classical/ewald/parameters.py
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 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 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 276 277 278 279 280 281 282 283 | |
kvecs_from_kmax(cell, kmax)
¶
Integer half-space lattice coefficients within the reciprocal kmax sphere.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cell
|
Cell[AnyPeriodicity]
|
Cell defining the reciprocal lattice. |
required |
kmax
|
float
|
Maximum reciprocal-vector magnitude in 1/Å. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Integer half-space lattice coefficients shaped |
Source code in src/kups/potential/classical/ewald/parameters.py
prepare_reciprocal_shifts(cells, k_max, *, compact)
¶
Batch sphere-filtered shifts, padding them or enclosing them in one grid.
Compact shifts use (0, 0, 0) as their bound. Grid shifts use the tightest
common axis bounds for all systems, including batches with different cells.
Source code in src/kups/potential/classical/ewald/parameters.py
reciprocal_grid_bound(cell, kmax)
¶
Uniform coefficient bound enclosing the reciprocal kmax sphere.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cell
|
Cell[AnyPeriodicity]
|
Cell defining the reciprocal lattice. |
required |
kmax
|
float
|
Maximum reciprocal-vector magnitude in 1/Å. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Integer scalar bound enclosing the reciprocal cutoff sphere. |
Source code in src/kups/potential/classical/ewald/parameters.py
reciprocal_grid_shifts(bound)
¶
Integer half-space grid: nonnegative x, signed y/z, x-major.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bound
|
int | ReciprocalGridBound
|
Nonnegative maximum absolute lattice coefficients, or one bound for all three axes. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Integer coefficients shaped |