Rectangular-waveguide dispersion in Damon-Eshbach geometry#
In this example, we will calculate the equilibrium state and dispersion relation in a rectangular permalloy waveguide with an 160 nm x 10 nm cross-section under an applied transversal field of 200 mT.
[1]:
import tetrax as tx
sample = tx.Sample(
tx.geometries.waveguide.rectangular(
width = 160,
thickness = 10,
cell_size_width = 2,
cell_size_thickness = 2,
),
name = "rect_Py_WG_160x10"
)
sample.material = tx.materials.permalloy
sample.show()
/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.
warnings.warn(
[1]:
Next, we transversally satured the sample. For this, apply the external field and relax it, starting from a homogeneously tilted state. After the relaxation is succeded, we plot its right away.
[2]:
sample.mag = tx.vectorfields.homogeneous(sample.xyz, theta=60.0, phi=10.0)
sample.external_field = (200e-3, 0, 0)
success = False
while not success:
relaxation_result = tx.experiments.relax(sample, tolerance=1e-14)
success = relaxation_result.was_success
relaxation_result.plot(renderer="notebook") # remove the renderer argument when running on your computer
Minimizing energy in using 'L-BFGS-B' (tolerance 1e-14) ...
energy length density: -2.037861670450534e-10 J/m, <mag.x> = 1.00, <mag.y> = -0.00, <mag.z> = 0.00
Success!
Plotting the magnetization shows that we are in the intended state.
[3]:
sample.show(scale=10)
/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.
[3]:
Now, let us calculate the spin-wave spectrum.
[4]:
spectrum = tx.experiments.eigenmodes(sample, num_cpus=-1,num_modes=10, num_k=81, kmin=0)
100%|███████████████████| 81/81 [00:04<00:00, 17.44it/s]
We plot the dispersion using the built-in plot() method.
[5]:
spectrum.plot(k=(0,40e6), renderer="notebook") # remove the renderer argument when running on your computer