ZhangLi#
- class micromagneticmodel.ZhangLi(**kwargs)#
Zhang-Li spin transfer torque dynamics term.
\[\frac{\text{d}\mathbf{m}}{\text{d}t} = -\frac{1+\alpha\beta}{1+\alpha^{2}} \mathbf{m} \times (\mathbf{m} \times (\mathbf{u} \cdot \boldsymbol\nabla) \mathbf{m}) - \frac{\beta - \alpha}{1+\alpha^{2}} \mathbf{m} \times (\mathbf{u} \cdot \boldsymbol\nabla)\mathbf{m}\]A time-dependent current can be specified by providing a time-dependent pre-factor that is used to multiply
u. The time-dependence can either be specified by providing a callablefuncthat is evaluated at time stepsdtor by passing a dictionarytcl_stringsof tcl strings that are written to the mif file.- Parameters:
beta (numbers.Real) – A single scalar value can be passed.
u (number.Real, array-like, dict, discretisedfield.Field) – Spin-drift velocity in m/s. If a scalar value or
Fieldwithnvdim==1is passed, the current is assumed to flow in x direction. A vector (array_like of length 3) or aFieldwithnvdim==3can be used to specify arbitrary current direction. When using adicteither all elements must be scalar (current in x direction) or a vector must be used for each key.func (callable, optional) – Callable to define arbitrary time-dependence, multiplies
u. Called at times that are multiples ofdt. Must return a single number.dt (numbers.Real, optional (required for
func)) – Time steps in seconds to evaluate callablefuncat.tcl_strings (dict, optional) – Dictionary of
tclstrings to be included into themiffile for more control over specific time-dependencies. Must contain the following keys:script,script_args, andscript_name. Refer to the OOMMF documentation for more details (behaves similar to Slonczewski current/Oxs_SpinXferEvolve: https://math.nist.gov/oommf/doc/userguide20a3/userguide/Standard_Oxs_Ext_Child_Clas.html#SX).
Examples
Defining the Zhang-Li dynamics term using scalar.
>>> import micromagneticmodel as mm ... >>> zhangli = mm.ZhangLi(beta=0.01, u=5e6)
Defining the Zhang-Li dynamics term using
discretisedfield.Field.
>>> import discretisedfield as df ... >>> region = df.Region(p1=(0, 0, 0), p2=(5e-9, 5e-9, 5e-9)) >>> mesh = df.Mesh(region=region, n=(5, 5, 5)) >>> beta = 0.012 >>> u = df.Field(mesh, nvdim=1, value=1e5) >>> zhangli = mm.ZhangLi(beta=beta, u=u)
Defining a sinusoidal decaying current.
>>> import micromagneticmodel as mm >>> import numpy as np ... >>> def sin_wave(t): ... omega = 2 * np.pi / 1e-9 ... return np.sin(omega * t) >>> zhangli = mm.ZhangLi(beta=0.01, u=5e6, func=sin_wave, dt=1e-13)
Defining the Zhang-Li dynamics term using vector.
>>> zhangli = mm.ZhangLi(beta=0.1, u=(0, 0, 1e12))
Methods
__add__Binary
+operator.__dir__Default dir() implementation.
__eq__Relational operator
==.__iter__Iterator.
__repr__Representation string.
dmdtProperties
betaDescriptor allowing setting attributes only with scalars (
numbers.Real).dtDescriptor allowing setting attributes only with scalars (
numbers.Real).funcDescriptor allowing setting attributes only with values of a certain type.
nameName.
tcl_stringsDescriptor allowing setting attributes with a dictionary, which has keys defined by
key_descriptorand values defined byvalue_descriptor.ucustom type for Zhand-Li current density u.