Gauge variance of diamagnetic and paramagnetic moments