Study of the Effect of Multipolar Components in the SPARC Emittance Compensation Gun Solenoid