A method for magnetic field generation for an atomic sensor, the method comprising: laser cooling a sample of atoms in a chamber; and trapping the sample of atoms in a magneto-optical trap within the chamber by applying an atom trapping magnetic field across the sample of atoms, characterized by using at least one pair of electro-permanent magnet units (201-1, 201-2), wherein each electro-permanent magnet unit of the at least one pair of electro-permanent magnet units (201-1, 201-2) comprises: a first magnetic ring of a first magnetic material; a second magnetic ring of a second magnetic material; and a coil of magnet wire that is wrapped around one or both of the first magnetic ring and the second magnetic ring; wherein applying an atom trapping magnetic field across the sample of atoms further comprises applying a first pulse of current having a first duration and amplitude to the coil, wherein the first pulse of current switches each electro-permanent magnet unit from an off state to an on state by switching a magnetic polarity of the second magnetic ring without switching a polarity of the first magnetic ring; the first magnetic material having a first magnetic hardness sufficient to not change polarity in response to the first pulse of current and the second magnetic material having a second magnetic hardness less than the first magnetic material such that the second magnetic material will change polarity in response to the first pulse of current, but wherein the second magnetic hardness is sufficient to not change polarity in response to the first magnetic field of the first magnetic ring; wherein in the off state, a first magnetic field of the first magnetic ring and a second magnetic field of the second magnetic ring are oppositely polarized to offset each other, and wherein, in the on state, the first magnetic field of the first magnetic ring and the second magnetic field of the second magnetic ring are similarly polarized to add to each other and wherein each of the electro-permanent magnet units of the at least one pair of electro-permanent magnet units (201-1, 201-2) are oriented with respect to the magneto-optical trap so that when they are both switched to the on state, the polarities of their respective magnetic fields are anti-parallel and offset each other at the center of the magneto-optical trap resulting in an atom trapping magnetic gradient. laser cooling a sample of atoms in a chamber; and trapping the sample of atoms in a magneto-optical trap within the chamber by applying an atom trapping magnetic field across the sample of atoms, characterized by using at least one pair of electro-permanent magnet units (201-1, 201-2), wherein each electro-permanent magnet unit of the at least one pair of electro-permanent magnet units (201-1, 201-2) comprises: a first magnetic ring of a first magnetic material; a second magnetic ring of a second magnetic material; and a coil of magnet wire that is wrapped around one or both of the first magnetic ring and the second magnetic ring; a first magnetic ring of a first magnetic material; a second magnetic ring of a second magnetic material; and a coil of magnet wire that is wrapped around one or both of the first magnetic ring and the second magnetic ring; wherein applying an atom trapping magnetic field across the sample of atoms further comprises applying a first pulse of current having a first duration and amplitude to the coil, wherein the first pulse of current switches each electro-permanent magnet unit from an off state to an on state by switching a magnetic polarity of the second magnetic ring without switching a polarity of the first magnetic ring; the first magnetic material having a first magnetic hardness sufficient to not change polarity in response to the first pulse of current and the second magnetic material having a second magnetic hardness less than the first magnetic material such that the second magnetic material will change polarity in response to the first pulse of current, but wherein the second magnetic hardness is sufficient to not change polarity in response to the first magnetic field of the first magnetic ring; wherein in the off state, a first magnetic field of the first magnetic ring and a second magnetic field of the second magnetic ring are oppositely polarized to offset each other, and wherein, in the on state, the first magnetic field of the first magnetic ring and the second magnetic field of the second magnetic ring are similarly polarized to add to each other and wherein each of the electro-permanent magnet units of the at least one pair of electro-permanent magnet units (201-1, 201-2) are oriented with respect to the magneto-optical trap so that when they are both switched to the on state, the polarities of their respective magnetic fields are anti-parallel and offset each other at the center of the magneto-optical trap resulting in an atom trapping magnetic gradient.