mag2exp.mfm.phase_shift#

mag2exp.mfm.phase_shift(field, /, tip_m=(0, 0, 0), quality=650, k=3, tip_q=0, fwhm=None)#

Calculation of the phase shift of an MFM tip.

The contrast in MFM images originates from the magnetic interaction between the magnetic tip of an oscillating cantilever and the samples stray field. As MFM is based on the stray field outside of a sample, an ‘airbox’ method should be used. This mean that the saturation magnetisation should be set to zero in the region outside the sample in which we wish to perform these MFM measurements.

The magnetic cantilever is driven to oscillate near its resonant frequency when there is no stray field. In the presence of a stray magnetic field the phase shift of MFM cantilever is given by

\[\Delta \phi = \frac{Q\mu_0}{k} \left( q \frac{\partial {\bf H}_{sz}}{\partial z} + {\bf M}_t \cdot \frac{\partial^2{\bf H}_{s}}{\partial z^2} \right),\]

where \(Q\) is the quality factor of the cantilever, \(k\) is the spring constant of the cantilever in \(\textrm{Nm}^{-1}\), \(q\) is the effective magnetic monopole moment of the tip in \(\textrm{Am}^{-2}\), \({\bf M}_t\) is the effective magnetic dipole moment of the tip in \(\textrm{Am}^{-1}\) and, \({\bf H}_{sz}\) is the magnetic field due to the sample in \(\textrm{Am}^{-1}\).

Parameters:
  • field (discretisedfield.Field) – Magnetisation field.

  • tip_m (numbers.Real, array_like) – The effective magnetic dipole moment of the tip in the \(x\), \(y\), and \(z\) directions, respectively. Values are given in units of \(\textrm{Am}^{-1}\).

  • quality (numbers.Real) – The quality factor of the tip. Should be a real, positive number.

  • k (numbers.Real) – The spring factor of the MFM cantilever. This should be a real, positive, non-zero number.

  • tip_q (numbers.Real) – The effective magnetic monopole moment of the tip in units of \(\textrm{Am}^{-2}\).

Returns:

Phase shift of MFM cantilever.

Return type:

discretisedfield.Field

Examples

  1. Visualising MFM with matplotlib.

>>> import discretisedfield as df
>>> import micromagneticmodel as mm
>>> import mag2exp
>>> mesh = df.Mesh(p1=(-25e-9, -25e-9, -2e-9),
...                p2=(25e-9, 25e-9, 50e-9),
...                cell=(1e-9, 1e-9, 2e-9))
>>> def v_fun(point):
...     x, y, z = point
...     if x < -2e-9:
...         return (0, 0, 1)
...     elif x < 2e-9:
...         return (0, 1, 0)
...     else:
...         return (0, 0, -1)
>>> def Ms_fun(pos):
...     x, y, z = pos
...     if (z < 0):
...         return 384e3
...     else:
...         return 0
>>> field = df.Field(mesh, nvdim=3, value=v_fun, norm=Ms_fun)
>>> ps = mag2exp.mfm.phase_shift(field, tip_m=(0, 0, 1e-16))
>>> ps.sel(z=10e-9).mpl.scalar()
>>> ps.sel(z=40e-9).mpl.scalar()
../../_images/mag2exp-mfm-phase_shift-1_00.png
../../_images/mag2exp-mfm-phase_shift-1_01.png
  1. Visualising in-plane MFM with matplotlib.

>>> import discretisedfield as df
>>> import micromagneticmodel as mm
>>> import mag2exp
>>> mesh = df.Mesh(p1=(-25e-9, -25e-9, -2e-9),
...                p2=(25e-9, 25e-9, 50e-9),
...                cell=(1e-9, 1e-9, 2e-9))
>>> def v_fun(point):
...     x, y, z = point
...     if x < -2e-9:
...         return (0, 0, 1)
...     elif x < 2e-9:
...         return (0, 1, 0)
...     else:
...         return (0, 0, -1)
>>> def Ms_fun(pos):
...     x, y, z = pos
...     if (z < 0):
...         return 384e3
...     else:
...         return 0
>>> system = mm.System(name='Box2')
>>> system.energy = mm.Demag()
>>> system.m = df.Field(mesh, nvdim=3, value=v_fun, norm=Ms_fun)
>>> ps = mag2exp.mfm.phase_shift(system.m, tip_m=(1e-16, 0, 0))
>>> ps.sel(z=10e-9).mpl.scalar()
>>> ps.sel(z=40e-9).mpl.scalar()
../../_images/mag2exp-mfm-phase_shift-2_00.png
../../_images/mag2exp-mfm-phase_shift-2_01.png
  1. Visualising monopole moment MFM with matplotlib.

>>> import discretisedfield as df
>>> import micromagneticmodel as mm
>>> import mag2exp
>>> mesh = df.Mesh(p1=(-25e-9, -25e-9, -2e-9),
...                p2=(25e-9, 25e-9, 50e-9),
...                cell=(1e-9, 1e-9, 2e-9))
>>> def v_fun(point):
...     x, y, z = point
...     if x < -2e-9:
...         return (0, 0, 1)
...     elif x < 2e-9:
...         return (0, 1, 0)
...     else:
...         return (0, 0, -1)
>>> def Ms_fun(pos):
...     x, y, z = pos
...     if (z < 0):
...         return 384e3
...     else:
...         return 0
>>> system = mm.System(name='Box2')
>>> system.energy = mm.Demag()
>>> system.m = df.Field(mesh, nvdim=3, value=v_fun, norm=Ms_fun)
>>> ps = mag2exp.mfm.phase_shift(system.m, tip_q=1e-9)
>>> ps.sel(z=10e-9).mpl.scalar()
>>> ps.sel(z=40e-9).mpl.scalar()
../../_images/mag2exp-mfm-phase_shift-3_00.png
../../_images/mag2exp-mfm-phase_shift-3_01.png