-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Hello team,
I am trying to replicate the H-field inside a gyrotropic medium and so, I am struggling to define a circularly polarised magnetic field for spin wave excitation in a stripe. The field must be a sinc. Diving through the API, I cannot find code related to serve my purpose (maybe it is just me not looking well into it!).
So far, I was thinking on defining two zeeman fields, one in quadrature with the first, but I don't know how to write this in ubermag ...
Something starting with system.energy += mm.Zeeman(H=(1,1,1), name='Hsinc_circ_pol', func=H_circ_pol, dt=dt_)...
Then I defined H_circ_pol as a time-dependent function of a circularly polarized wave:
`def H_circ_pol(t):
t_0 = 20*dt_
freq = 20e9
sinc_bw = 1/ (5*dt_)
omega = 2 * np.pi * freq
H0 = 1
envelope = np.sinc(sinc_bw * (t - t_0))
handedness = 'left'
# Field components
if handedness == 'right':
Hx = H0 * envelope * np.cos(omega * t)
Hy = H0 * envelope * np.sin(omega * t)
elif handedness == 'left':
Hx = H0 * envelope * np.cos(omega * t)
Hy = -H0 * envelope * np.sin(omega * t)
else:
raise ValueError("handedness must be 'right' or 'left'")
Hz = np.zeros_like(t)
return np.stack((Hx, Hy, Hz), axis=-1)`
But this prompts a runtime rror in oommf... Any suggestions on how to implement this idea?
Many thanks for your help!!
Cheers,