A system for controlling the temperature of a persistent current switch operating in a background magnetic field, the system comprising: a heat exchanger configured to disperse heat to a cryocooler; a loop tube (135; 235; 335) configured to enable flow of coolant to convectively transfer thermal energy generated by the persistent current switch to the heat exchanger; and a thermal switch (131; 231; 331; 431, 432), characterized in that the thermal switch (131; 231; 331; 431, 432) comprises: a ball valve (245; 345) integrated with the loop tube (135; 235; 335) adapted to be positioned between the persistent current switch and the heat exchanger, the ball valve (245; 345) containing a ferromagnetic ball (250; 350) having a diameter greater than an inner diameter of an opening of the loop tube (135; 235; 335) or of an orifice in the ball valve adjoining the opening of the loop tube (135; 235; 335); and a plurality of electromagnets (251, 252; 351, 352) positioned outside the loop tube (135; 235; 335) adjacent to the ball valve (245; 345), wherein energizing a first electromagnet (251; 351) of the plurality of electromagnets (251, 252; 351, 352) magnetically moves the ferromagnetic ball (250; 350) to a first position opening the loop tube (135; 235; 335) and enabling the flow of the coolant, and energizing a second electromagnet (252; 352) of the plurality of electromagnets (251, 252; 351, 352) magnetically moves the ferromagnetic ball (250; 350) to a second position closing the loop tube (135; 235; 335) and blocking the flow of the coolant. a heat exchanger configured to disperse heat to a cryocooler; a loop tube (135; 235; 335) configured to enable flow of coolant to convectively transfer thermal energy generated by the persistent current switch to the heat exchanger; and a thermal switch (131; 231; 331; 431, 432), characterized in that the thermal switch (131; 231; 331; 431, 432) comprises: a ball valve (245; 345) integrated with the loop tube (135; 235; 335) adapted to be positioned between the persistent current switch and the heat exchanger, the ball valve (245; 345) containing a ferromagnetic ball (250; 350) having a diameter greater than an inner diameter of an opening of the loop tube (135; 235; 335) or of an orifice in the ball valve adjoining the opening of the loop tube (135; 235; 335); and a plurality of electromagnets (251, 252; 351, 352) positioned outside the loop tube (135; 235; 335) adjacent to the ball valve (245; 345), wherein energizing a first electromagnet (251; 351) of the plurality of electromagnets (251, 252; 351, 352) magnetically moves the ferromagnetic ball (250; 350) to a first position opening the loop tube (135; 235; 335) and enabling the flow of the coolant, and energizing a second electromagnet (252; 352) of the plurality of electromagnets (251, 252; 351, 352) magnetically moves the ferromagnetic ball (250; 350) to a second position closing the loop tube (135; 235; 335) and blocking the flow of the coolant. a ball valve (245; 345) integrated with the loop tube (135; 235; 335) adapted to be positioned between the persistent current switch and the heat exchanger, the ball valve (245; 345) containing a ferromagnetic ball (250; 350) having a diameter greater than an inner diameter of an opening of the loop tube (135; 235; 335) or of an orifice in the ball valve adjoining the opening of the loop tube (135; 235; 335); and a plurality of electromagnets (251, 252; 351, 352) positioned outside the loop tube (135; 235; 335) adjacent to the ball valve (245; 345), wherein energizing a first electromagnet (251; 351) of the plurality of electromagnets (251, 252; 351, 352) magnetically moves the ferromagnetic ball (250; 350) to a first position opening the loop tube (135; 235; 335) and enabling the flow of the coolant, and energizing a second electromagnet (252; 352) of the plurality of electromagnets (251, 252; 351, 352) magnetically moves the ferromagnetic ball (250; 350) to a second position closing the loop tube (135; 235; 335) and blocking the flow of the coolant.