cupy#
Includes our CUDA inplace kernels.
Modules:
-
inplace–Includes our CUDA inplace kernels.
Functions:
-
scatter_add_scaled–Adds array
bto arrayaat indicesindsin-place. -
scatter_add_scaled_obc–Adds array
bto arrayaat indicesindin-place with OBC repetitions.
scatter_add_scaled
#
scatter_add_scaled(a: NDArray, b: NDArray, inds: NDArray, alpha: complex | float = 1.0, conjugate: bool = False) -> None
Adds array b to array a at indices inds in-place.
Parameters:
-
a(NDArray) –The array to be updated.
-
b(NDArray) –The array to be added to
a. -
inds(NDArray) –The indices at which to add
btoa. -
alpha(complex | float, default:1.0) –The scalar multiplier for
bbefore adding it toa. -
conjugate(bool, default:False) –Whether to take the complex conjugate of
bbefore adding it toa.
scatter_add_scaled_obc
#
scatter_add_scaled_obc(a: NDArray, b: NDArray, inds: NDArray, k: tuple[float, float], transverse_repetition_grid: tuple[int, int], alpha: float = 1.0)
Adds array b to array a at indices ind in-place with OBC repetitions.
Parameters:
-
a(NDArray) –The array to be updated.
-
b(NDArray) –The array to be added to
a. -
inds(NDArray) –The indices at which to add
btoa. -
k(tuple[float, float]) –The transverse wavevector components.
-
transverse_repetition_grid(tuple[int, int]) –The transverse repetition grid of the contact.
-
alpha(float, default:1.0) –The scalar multiplier for
bbefore adding it toa.