Advanced technical solution for the design of a low perveance electron gun with a high quality beam dedicated to high power Ka-band klystrons is presented in this paper. The proposed electron gun can be used to feed linear accelerating structures at 36 GHz with an estimated input power of 20 MW, thus achieving an effective accelerating electric field in the (100-150) MV/m range. additionally, in the framework of the Compact Light XLS project, a short Ka-band accelerating structure providing an integrated voltage of at least 15 MV, has been proposed for bunch-phase linearization. For the klystron, a very small beam dimension is needed and the presented electron gun responds to this requirement. An estimate of the rotational velocity at beam edge indicates that the diamagnetic field due to rotational currents are small compared to the longitudinal volume. A detailed analysis of how this is arrived at, by compression of the beam, rotation in the magnetic field, and analysis of the subsequently generated diamagnetic field has been discussed.