A magnetic device includes a substrate and an array including a plurality of magnetic particles, in which a magnetic dipole moment direction of each magnetic particle in a majority of the magnetic particles in the array alternates with respect to a magnetic dipole direction of a directly adjacent magnetic particle or directly adjacent magnetic particles in the array.