A Spectral Algorithm for Solving the Relativistic Vlasov-Maxwell Equations