bijx.complex_affine_apply

bijx.complex_affine_apply(x, log_density, *, scale=None, phase=None, shift=None, delta_ld=None, invert=False)[source]

Stateless complex affine transform.

Forward: \(y = s \cdot e^{i\varphi} \cdot x + b\). Reverse: \(x = (y - b) \cdot e^{-i\varphi} / s\).

Parameters:
  • x – Input array (real or complex).

  • log_density – Log-density accumulator.

  • scale – Multiplicative factor, broadcastable to x. Applied as-is (no abs/exp); may be real or complex.

  • phase – Angle in radians, broadcastable to x. Applied as multiplication by exp(1j * phase).

  • shift – Additive term, broadcastable to x.

  • delta_ld – Precomputed forward log-Jacobian contribution \(\sum_i w_i \log|s_i|\). The accumulator is updated by \(-\Delta\) in the forward direction and \(+\Delta\) in the reverse direction.

  • invert – If True, applies the inverse transform.

Returns:

Tuple (y, log_density).