desymmetrize - cchandre/HamLorenz GitHub Wiki

desymmetrize (function)

Purpose

Removes the translational symmetry (e.g., phase drift) from a state vector by aligning its Fourier phases.

Parameters

  • vec: A 1D or 2D array representing the system state(s) over space (axis 0) and optionally time or ensemble (axis 1).

Description

This function performs the following steps:

  1. Computes the Fast Fourier Transform (FFT) of the input vector along the spatial axis.
  2. Extracts and unwraps the phase of the first non-zero Fourier mode to determine the global phase shift.
  3. Constructs a phase correction factor using the wavenumbers from fftfreq.
  4. Applies the phase correction in Fourier space to eliminate the symmetry-induced shift.
  5. Transforms back to physical space using the inverse FFT, returning only the real part.

Returns

  • A real-valued array with the same shape as vec, where translational symmetry has been factored out.

Notes

  • Assumes periodic boundary conditions.
  • Useful for analyzing dynamics in a co-moving frame or computing quantities like symmetry-reduced Lyapunov exponents.