def METHOD_NAME(grid, fourier_grid, sort_by_energy=True):
    '''Make a complex Fourier basis.
    Fourier modes this function are defined to be complex. For each point in `fourier_grid` the complex Fourier mode is contained in the output.
    Parameters
    ----------
    grid : Grid
        The :class:`Grid` on which to calculate the modes.
    fourier_grid : Grid
        The grid defining all frequencies.
    sort_by_energy : bool
        Whether to sort by increasing energy or not.
    Returns
    -------
    ModeBasis
        The mode basis containing all Fourier modes.
    '''
    c = np.array(grid.coords)
    modes = [Field(np.exp(1j * np.dot(p, c)), grid) for p in fourier_grid.points]
    energies = [np.dot(p, p) for p in fourier_grid.points]
    if sort_by_energy:
        ind = np.argsort(energies)
        modes = [modes[i] for i in ind]
    return ModeBasis(modes, grid)