Phase profile of a specific mode

49 views
Skip to first unread message

Diksha Prajapati

unread,
Mar 18, 2026, 12:53:23 PMMar 18
to mumax2

I am trying to plot the spin-wave phase profile corresponding to a specific frequency. In my simulation, the static magnetic field is applied along the x-axis, while the dynamic magnetization components exist along the y and z directions.

To calculate the phase, I assumed that the total dynamic magnetization can be expressed as . However, the results I am obtaining do not appear consistent when compared with those reported in the literature.

Could someone please confirm whether this is the correct approach? If not, I would appreciate guidance on the proper method for calculating the phase.

Thank you in advance for your help.


sw_phase=np.arctan2(np.real(mz_mode),np.real(my_mode))

here, 
mz_mode = mz_fft[mode1_idx]
my_mode = my_fft[mode1_idx]

Felipe Garcia

unread,
Mar 19, 2026, 8:14:31 AMMar 19
to mum...@googlegroups.com
Hi,

There may be at least several problems. It is not straightforward to achieve the phase but it is not so difficult either.

The first reason may be that your static magnetization is not along X. Then you have to compute your dynamics magnetization locally. If your sample is saturated along X, because the field is strong enough, the one will have no problem like this. In case you have boundary structures this may affect the way to calculate the phase in those regions. The normalization of the dynamical m is not important because you are using the ratio implicitly.

The next is that if you are comparing the phase with and without unwrapping. The phase obtained like that is from -Pi to Pi. This means that if you would like to have a phase Phi, whose derivative is the angular frequency, then it will not work properly. For that one has to unwrap the phase. In matlab this is achieved with the unwrap function. A similar function exists in numpy. Then there is a continuous version of the phase, whose numerical derivative is well defined. More or less then Phi=Omega*t+Phi0. Using a derivative and or a linear fit one should achieve the correct results. Also in this case, Omega has a sign. The phase can be increased or decreased depending on the situation.

There may be additional problems if your signal is not monochromatic and then the phase is not well defined. If it still does work for you maybe that is the reason. In this case, one should do FFT filters and it will not be so easy and maybe not worth the effort. In a clean case, after using the unwrapping then it should work nicely.

Best regards,
Felipe

--
You received this message because you are subscribed to the Google Groups "mumax2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mumax2+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mumax2/bd13b51e-f755-40e7-830d-bc26b047bc05n%40googlegroups.com.

Антон Луценко

unread,
Mar 20, 2026, 6:50:46 AM (14 days ago) Mar 20
to mumax2
Hi Diksha, 

I have been routinely doing this kind of analysis so I recognize your trouble. 

Let's say for now that the sample is fully magnetized in X direction. Your main assumption here seems to be that the spin precession is perfectly circular, i.e. my and mz have the same magnitude and that their phase is shifted by exactly π/2. That is often not the case. Usually the spin wave would be elliptical, sometimes with the opposite precession direction, so I recommend abandoning this approach.

The simplest way to extract the wave properties (profile, phase, etc.) is to only look at one component – for example, mz. Many spin-wave papers usually showcase only the out-of-plane component of dynamic magnetization. Since your FFT yields complex amplitude, you can extract the profile by just applying np.real(mz_mode), and the phase by np.angle(mz_mode). I strongly recommend looking at the dynamics by plotting np.real(mz_mode * time_phasor), where time_phasor evolves on a complex unit circle.

If you want to consider the full wave, you can look into Jones calculus. Basically, you can treat vector of complex numbers [my_mode, mz_mode] as Jones vector for spin waves, and use it in the same way. And for example, you can plot the precession ellipse using np.real( myz_jones * time_phasor ), where myz_jones is the said [my_mode, mz_mode] and time_phasor evolves on a complex unit circle. 

Hope that helps! 

Diksha Prajapati

unread,
Mar 20, 2026, 9:36:31 AM (13 days ago) Mar 20
to mumax2
Thank you for your reply.

Diksha Prajapati

unread,
Mar 20, 2026, 9:38:26 AM (13 days ago) Mar 20
to mumax2
Thank you for your reply. It really helped a lot. However, I am not able to get how to define time phasor here. Could you please help me with it? 

With regards,
Diksha

Антон Луценко

unread,
Mar 20, 2026, 11:35:59 AM (13 days ago) Mar 20
to mumax2
Something like the exp(i*φ), where φ changes from 0 to 2π. If you want to do a time animation, e.g. with matplotlib, you would do something like

N_frames = 32
phasor_list = np.exp(1j * np.linspace(0, 2*np.pi, N_frames, endpoint=False))
# ...
def update(frame):
    line_data = np.real(mz_mode * phasor_list[frame])
    # ...
ani = animation.FuncAnimation(fig=fig, func=update, frames=N_frames, ...)

Though I personally prefer generating it with 

phasor_list = 1j ** ( 4 * np.linspace(0, 1, N_frames, endpoint=False) ) 

Diksha Prajapati

unread,
Mar 20, 2026, 12:37:25 PM (13 days ago) Mar 20
to mumax2
Thank you again. I will definitely try it.

With regards,
Diksha

Reply all
Reply to author
Forward
0 new messages