Study of the effect of multipolar components in the SPARC emittance compensation gun solenoid