Abstract. The task of the transportation of the polarized proton and deuteron beam of an energy 10-20 keV in the given magnetic field is considered. Specifically the magnetic field is produced by the system of a solenoid and some ring permanent magnets with contrary directed field. The Lorentz equations together with classic equations for vector and tensor polarizations have been solved. The results of the numerical simulation for a simple tworing system are presented, which shows there is no essential depolarization in agrement with theoretical estimation.The problem of transporting a polarized deuteron beam [1] with an energy of 10-20 keV in the magnetic field altering in direction and magnitude is considered. In the particular case of the polarized ion source, we have the system of a solenoid and two ring permanent magnets with counter fields (Fig. 1).We choose the coordinate system with the origin at the center of the ring system, the axis x is along the direction of motion of the deuteron beam and the axis z is in the vertical direction. For paraxial trajectories the radial magnetic field is calculated as usual:So, the field on the axis of the solenoid iswhere µ 0 = 4π10 −7 N/A 2 , x 1 = x + L -the distance from the point of measuring to the proximal end of the solenoid, L -the distance from the origin to the proximal end of the solenoid, x 2 = x + L + l -the distance from the point of measuring to the distal end of the solenoid, l -the length of the solenoid, r 1 -the inner radius of the solenoid, r 2 -the outer radius, n -the number of turns per unit of length of the solenoid, I -the solenoid current. The magnetic field on the axis of the annular permanent magnet is calculated as the difference of the field values of two solid cylinders. For a cylinder with magnetization M = B 0 /µ 0 (B 0 -the residual field) the axial field in the function of the distance t from the center of the magnet can be calculated by:where a and 2b -the radius and length of the cylinder.