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 callable func that is evaluated at time steps dt or by passing a dictionary tcl_strings of tcl strings that are written to the mif file.

Parameters:
  • beta (numbers.Real) – A single scalar value can be passed.

  • u (number.Real, discretisedfield.Field) – numbers.Real can be passed, or alternatively discretisedfield.Field can be passed.

  • func (callable, optional) – Callable to define arbitrary time-dependence, multiplies u. Called at times that are multiples of dt. Must return a single number.

  • dt (numbers.Real, optional (required for func)) – Time steps in seconds to evaluate callable func at.

  • tcl_strings (dict, optional) – Dictionary of tcl strings to be included into the mif file for more control over specific time-dependencies. Must contain the following keys: script, script_args, and script_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

  1. Defining the Zhang-Li dynamics term using scalar.

>>> import micromagneticmodel as mm
...
>>> zhangli = mm.ZhangLi(beta=0.01, u=5e6)
  1. 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)
  1. 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)
  1. An attempt to define the Zhang-Li dynamics term using a wrong value (here using a vector u where a scalar value is required).

>>> zhangli = mm.ZhangLi(beta=-1, u=(0, 0, 1))  # vector value
Traceback (most recent call last):
...
TypeError: ...

Methods

__add__

Binary + operator.

__dir__

Default dir() implementation.

__eq__

Relational operator ==.

__iter__

Iterator.

__repr__

Representation string.

dmdt

Properties

beta

Descriptor allowing setting attributes only with scalars (numbers.Real).

dt

Descriptor allowing setting attributes only with scalars (numbers.Real).

func

Descriptor allowing setting attributes only with values of a certain type.

name

Name.

tcl_strings

Descriptor allowing setting attributes with a dictionary, which has keys defined by key_descriptor and values defined by value_descriptor.

u

Descriptor allowing setting attributes with a value described as descriptor or a dictionary.