def laplacian(y, factor=1.0, exp=False, kx2=None, twist_phase_x=None):
    """Return the laplacian of `y` times `factor` or the exponential of this.

        Parameters
        ----------
        factor : float
           Additional factor (mostly used with `exp=True`).  The
           implementation must be careful to allow the factor to
           broadcast across the components.
        exp : bool
           If `True`, then compute the exponential of the laplacian.
           This is used for split evolvers.
        k2x : None, array
           Replacement for the default `kx2=kx**2` used when computing the
           "laplacian".
        twist_phase_x : array, optional
           To implement twisted boundary conditions, one needs to remove an
           overall phase from the wavefunction rendering it periodic for use
           the the FFT.  This the the phase that should be removed.  Note: to
           compensate, the momenta should be shifted as well::

              -factor * twist_phase_x*ifft((k+k_twist)**2*fft(y/twist_phase_x)
        """
