check for sign=0 case

This commit is contained in:
Jan Petykiewicz 2025-01-14 21:51:32 -08:00
parent e54735d9c6
commit c543868c0b

View File

@ -435,6 +435,7 @@ def _normalized_fields(
sign = numpy.sign(E_weighted[:, sign = numpy.sign(E_weighted[:,
:max(shape[0] // 2, 1), :max(shape[0] // 2, 1),
:max(shape[1] // 2, 1)].real.sum()) :max(shape[1] // 2, 1)].real.sum())
assert sign != 0
norm_factor = sign * norm_amplitude * numpy.exp(1j * norm_angle) norm_factor = sign * norm_amplitude * numpy.exp(1j * norm_angle)