Skip to content

cupy#

Includes our CUDA inplace kernels.

Modules:

  • inplace

    Includes our CUDA inplace kernels.

Functions:

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 b to a.

  • alpha (complex | float, default: 1.0 ) –

    The scalar multiplier for b before adding it to a.

  • conjugate (bool, default: False ) –

    Whether to take the complex conjugate of b before adding it to a.

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 b to a.

  • 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 b before adding it to a.