## 3 Nanomagnetic Switches
This will inject  
Figure 2: A nanomagnet shaped like an elliptical disk has two stable magnetization orientations which can encode the binary bits 0 and 1. **(a)** In-plane magnetic anisotropy and **(b)** perpendicular magnetic anisotropy. (c) A magnetic tunnel junction (MTJ) showing the high (OFF) and low (ON) resistance states. spin-polarized electrons from the hard layer into the soft layer, whose spins are mostly aligned along the magnetization orientation of the hard layer. These injected electrons will transfer their spin angular momenta to the resident electrons in the soft layer, whose spins will then gradually turn in the direction of the injected spins and will magnetize the soft layer in a direction parallel to the magnetization of the hard layer. This is how the MTJ is turned \"on\". In order to turn it \"off\", we will reverse the polarity of the battery. This will inject electrons from the soft layer into the hard layer. However, because of spin-dependent tunneling through the spacer, those electrons whose spin polarizations are parallel to the magnetization of the hard layer will be preferentially injected. As these spins exit the soft layer their population is quickly depleted, leaving the opposite spins as the majority in the soft layer. That aligns the magnetization of the soft layer antiparallel to that of the hard layer. When that happens, the MTJ turns off. For any given magnitude of injected current (with a given degree of spin polarization \(\xi\)), we can calculate the switching error probability (at room temperature) associated with spin-transfer-torque switching of an MTJ by carrying out **Landau-Lifshitz-Gilbert-Langevin** simulation (also known as stochastic Landau-Lifshitz-Gilbert (s-LLG) simulation). To do this, we solve the following equation:  
\[\begin{array}{ll}\frac{d\vec{m}(t)}{dt}&=-\gamma\vec{m}(t)\times\vec{H}_{ \text{total}}(t)+\alpha\left(\vec{m}(t)\times\frac{d\vec{m}(t)}{dt}\right)\\ &+a\vec{m}(t)\times\left(\frac{\vec  
Using the vector identity \(\overrightarrow{a}\times\left(\overrightarrow{b}\times\overrightarrow{c} \right)=\overrightarrow{b}\left(\overrightarrow{a}\bullet\overrightarrow{c} \right)-\overrightarrow{c}\left(\overrightarrow{a}\bullet\overrightarrow{b}\right)\), we can recast the vector equation in Equation (8) as [12]:  
\[ \begin{array}{ll}\left(1+\alpha^{2}\right)\frac{d\overrightarrow{m}(t)}{dt}&= -\gamma\left(\overrightarrow{m}(t)\times\overrightarrow{H}_{\text{total}}(t) \right)-\gamma\alpha\left[\overrightarrow{m}(t)\left(\overrightarrow{m}(t) \bullet\overrightarrow{H}_{\text{total}}(t)\right)-\overrightarrow{H}_{ \text{total}}(t)\right]\\ &-(\alpha a-b)\left(\frac{\xi_{1}(t)\mu_{B}}{qM_{\text{c}}\Omega}\times \overrightarrow{m}(t)\right)+(a+\alpha b)\frac{\xi_{L}(t)\mu_{B}}{qM_{\text{c}} \Omega}\left[\hat{g}-\overrightarrow{m}(t)m_{y}(t)\right]\end{array}  \tag{9}\]  
This vector equation can be recast as three coupled scalar equations in the three Cartesian components of the magnetization vector [12]:  
\[\begin{array}{ll}(1+\alpha^{2})\frac{d\mu_{x}(t)}{dt}&=-\gamma\left[m_{y}(t) H_{z}(t)-m_{z}(t)H_{y}(t)\right]-\alpha\gamma\left[m_{x}(t)\left[m_{x}(t)H_{x}(t)+m_{y}(t) H_{y}(t)+m_{z}(t)H_{z}(t)\right]-H_{x}(t)\right]\\ &\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad-( \alpha a-b)\frac{\xi_{L}(t)\mu_{m_{z}}(t)\mu_{B}}{qM_{\text{c}}\Omega}-(a+\alpha b )\frac{\xi_{L}(t)\mu_{m_{z}}(t)\mu_{B}}{qM_{\text{c}}\Omega}\\ (1+\alpha^{2})\frac{d\mu_{y}(t)}{dt}&=-\gamma\left[m_{z}(t)H_{x}(t)-m_{x}(t)H_ {z}(t)\right]-\alpha\gamma\left[m_{y}(t)\left[m_{x}(t)H_{x}(t)+m_{y}(t)H_{y}(t )+m_{z}(t)H_{z}(t)\right]-H_{y}(t)\right]\\ &\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad \qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\