improve memory management in _energy_for_power_series