fdtdx.unfold_array

Contents

fdtdx.unfold_array#

fdtdx.unfold_array(arr, symmetry, spatial_axes, signs=None)[source]#

Mirror-and-concatenate a spatial array along each symmetric axis.

Generic building block used by unfold_detector_states(). For every axis a with symmetry[a] != 0 the array is flipped along its corresponding array axis spatial_axes[a] (optionally multiplied by a broadcastable per-component sign), and the mirror image is concatenated in front of the original.

Parameters:
  • arr (jax.Array) – Array to unfold.

  • symmetry (tuple[int, int, int]) – Per-axis symmetry (x, y, z); 0 axes are skipped.

  • spatial_axes (tuple[int, int, int]) – For each physical axis, the corresponding array axis.

  • signs (dict[int, jax.Array] | None) – Optional mapping physical-axis → broadcastable sign array applied to the mirror image (defaults to +1).

Returns:

The unfolded array.

Return type:

jax.Array