Mode profiles and their animations (movies)#
This notebook will calculate the dispersion relation of a film with 50 nm thickness and permalloy material parameters.
The dispersion is computed for the Damon-Eshbach geometry, wave vector perpendicular to the ground magnetic state stabilized by an external static magnetic field of 20 mT.
First we import the TetraX package.
[1]:
import tetrax as tx
Let’s create the 50 nm thick permalloy film…
[2]:
py_film = tx.Sample(
tx.geometries.layer.monolayer(50,2),
name="Monolayer_mode_movie",
geometry_type="layer")
py_film.material = tx.materials.permalloy
… and compute the dispersion with the applied external field:
[3]:
py_film.mag = (1,0,0)
py_film.Bext = (20e-3,0,0)
spectrum = tx.experiments.eigenmodes(py_film,kmin=0,kmax=40e6,num_modes=5,num_cpus=-1,save_mode_profiles=True)
100%|███████████████████| 81/81 [00:01<00:00, 45.32it/s]
First, we plot the dispersion, using the built-in plot() method:
[4]:
spectrum.plot(n=[0,1], kscale='u', k=[0,40e6], fscale='G')
Show modes and animate them#
The spectrum result object of the eigenmodes experiment has a built-in method show_mode, to visualize the modes od a given wave vector k, mode number n and azimuthal mode number m for axial geometries.
Most important options for the visualization and animation are:
- wave vector k=..., in [rad/m]
- mode number n=...
- mode number m=... # for axial geometries
- scaling the magnetization, scale=...,
- scaling the dynamical components, scale_mode=...
- with or without the equilibrium magnetization, on_equilibrium=True or False
- animated = True or False
- the requested periods, periods=...
- frames_per_period=...
- frames per seconds, fps=...
Below you find an example for a Daemon-Eshbach surface mode, namely the mode with n=1 for k=10 (rad/µm), choosing 10 periods, 30 frames per seconds, etc…
This mode, as expected, is localized mostly to one of the surfaces.
[5]:
spectrum.show_mode(k=10e6,n=1,periods=10,animated=True,scale=10,fps=30,scale_mode=2)
/Users/attilak/micromag/tetrax-tests/fresh_environement_test/venv/lib/python3.13/site-packages/traittypes/traittypes.py:97: UserWarning:
Given trait value dtype "float32" does not match required type "float32". A coerced copy has been created.
