FMR, beginning of a guide, some progress and some problems

1,118 views
Skip to first unread message

Milton Persson

unread,
Oct 6, 2019, 2:00:21 PM10/6/19
to Vampire Users
Hello!

I was hoping to be able to submit a guide on FMR, but it will only be the start of one, and then hopefully we can write the rest together.

Disclaimer: This is merely a shot in the dark from someone who has never seen FMR done with Vampire. It will only help you get started with the very basics.

Please comment on anything erronous or suboptimal, and please ask about anything that is unclear.

:::: Applying an alternating field and watching the spins turn in response ::::

We'll start with a bulk sample and a slowly alternating field for a predictable quasistatic response. (Points 5 to 14 below describe the creation of the attached file "input".)
  1. Create a folder called FMR.
  2. Copy the contents of vampire/tests/time-series into your FMR folder. (Co.mat and input)
  3. Open the file Co.mat and uncomment lines 14 and 16, about the exchange constant and the uniaxial anisotropy constant.
  4. Change the initial spin direction to be the x-direction,
        material[1]:initial-spin-direction=1,0,0
  5. Now open the file input and add the lines
        create:periodic-boundaries-x
        create:periodic-boundaries-y
        create:periodic-boundaries-z
    under the line
        create:crystal-structure = sc
    to make it a bulk sample.
    (There are some problems with not doing this, that become obvious when visualizing the spins
    . This in "problem 1" below.)
  6. Decrease the system size a bit to make it easier to see what the individual spins are doing, by replacing "7.7" in each "dimensions:system-size-" line with, e.g., 3.54.
  7. Set the temperature to zero (sim:temperature = 0.0) instead of 1000, to make things simple.
  8. Change the three lines about the simulation time to
        sim:time-steps-increment=100
        sim:total-time-steps=1000
        sim:time-step=1.0 !ps
    which will be appropriate for our rf field.
  9. Change the strength of the applied field from 0 T to 1 T (sim:applied-field-strength = 1.0 !T).
  10. Below the two lines about the applied field, add the lines
        sim:fmr-field-strength = 0.3!T
        sim:fmr-field-frequency = 1.0
        sim:fmr-field-unit-vector = 0,1,0
    for a 0.3 T rf field at 1.0 GHz along the y-direction, B_{fmr} = 0.3*sin(2*pi*1.0e9*t)*e_y.
  11. Change the program from time-series to fmr (sim:program=fmr).
  12. Remove some unnecessary output by deleting or out-commenting every line starting with "output:" except for output:magnetisation.
  13. Add the lines
        config:atoms
        config:atoms-output-rate=1
    to save files for visualizing the spins at each time step.

  14. I suggest removing/out-commenting the last three lines about what to print to the screen, to keep things simple.
  15. Now go into the FMR folder via a terminal and run the simulation with, e.g.,
        mpirun -np <number of cores to be used> <location of the executable file vampire-parallel>
    which could for example look like

        mpirun -np 6 ~/vampire/vampire-parallel
    if vampire is installed in your home directory and you want to run it with 6 cores in parallel.
  16. To visualize the spin movement, first run the executable vdc, located in util/vdc/ in the vampire installation directory. For me this would be achieved by running the command
        ~/vampire/util/vdc/vdc
  17. This generates input files and a "config" file (.ini) for the program povray. With povray installed you can now simply run the command
        povray spins
    "spins" will be interpreted as spins.ini, which contains some necessary/reasonable options for povray. The above command is in this case equivalent to

        povray -W800 -H600 +A0.3 +KFIO +KFF9 spins.pov
    where -W800 sets the width to 800 pixels; -H600 sets the height to 600 pixels; +A0.3 tells povray to do anti-aliasing until the difference between adjacent pixels is less than 0.3; +KFI0 tells povray to start with frame 0; +KFF9 tells povray to end with frame 9; and spins.pov is the input file.
  18. While povray is running it will display the images it produces, one by one. These can later be viewed separately or put together into an animation in a gif file with the command
        ffmpeg -i spins%01d.png output.gif
    where the number 1 is the number of digits in the png file names. (See the attached file quasistaticAni.gif)
  19. The magnetization is stored in the file "output", with m_x in column 1, m_y in column 2, and m_z in column 3. (I do not know what is displayed in the fourth column.) (The attached file quasistatic.png shows the results.)
Hopefully you will now have seen the spins being turned back and forth by the alternating field. One can see how it is quasistatic by how m_z remains at zero.

You can now increase the frequency to confirm that you get a dynamic response, try e.g.
    sim:fmr-field-frequency = 10.0
with
    sim:time-steps-increment=10
(The attached files dynamic.png and dynamicAni.gif show the results.)

Note: It seems that one should delete the old output files before running a new simulation in the same folder. So just run
        rm spins*; rm atoms*; rm crystal*; rm output

:::: Problem number 1 -- out-of-phase sublattices in non bulk systems ::::

The reason we looked at a bulk system is because it otherwise divides into sublattices in a way that I cannot explain nor get rid of. Remove the periodic boundary condition in the z-direction and you will see how the systems divides into 'layers' in which the spins rotate 180 degrees out of phase. (See the attached images dynamicFilm.png and spins80.png and spins81.png, of which the latter two are consecutive frames.) This spinning also seems to have little to do with the chosen parameters for the fmr field. By adding one more monolayer in the z-direction the spinning can be seen in the magnetisation data, and is of a frequency much higher than that of the fmr field.

I have tried raising the temperature, increasing the damping constant, adding surface roughness, removing crystalline anisotropy, using different materials, or initializing the spins to point along the applied field. The only thing that removes this sublattice division is (except for PBC) to set the exchange to 0, which we will actually do later. (See the attached images dynamicFilmNoExchange.png and dynamicFilmNoExchangeAni.gif, and notice how similar they are to the bulk results. Perhaps it is somehow obvious that they should be the same.)

There seems to be some net movement as governed by the alternating field, which can be seen when plotting the magnetisation. The only difference seems to be that the amplitude is smaller.

Despite this I have chosen to simulate films, by removing the PBC in the z-direction, and to look at the magnetisation only, skipping the visualization and removing the "config:"-lines from the input file.

:::: Performing a frequency sweep ::::

There may be many ways to do this, but we will make a bash script with a for-loop that creates a new input file every iteration and creates a copy of the output file with a name that contains the frequency used.

  1. When only caring about how to perform a frequency sweep, and not what the actual results are, it is easiest to first go into the material file Co.mat and set the exchange to 0,
        material[1]:exchange-matrix[1] = 0
  2. Open a new file "frequencySweep.sh" in a text editor. (Finished file attached as frequencySweep.sh)
  3. Here is an example of what you might put inside:
    1. for i in {5..100..5}
    2. do
    3.     rm input

    4.     echo "create:crystal-structure = sc" > input
    5.     echo "create:periodic-boundaries-x" >> input
    6.     echo "create:periodic-boundaries-y" >> input
    7.     echo "dimensions:unit-cell-size = 3.54 !A" >> input
    8.     echo "dimensions:system-size-x = 3.54 !nm" >> input
    9.     echo "dimensions:system-size-y = 3.54 !nm" >> input
    10.     echo "dimensions:system-size-z = 3.54 !nm" >> input
    11.     echo "material:file = Co.mat" >> input
    12.     echo "sim:temperature = 0.0" >> input
    13.     echo "sim:time-steps-increment = 1" >> input
    14.     echo "sim:total-time-steps = 100" >> input
    15.     echo "sim:time-step = 1 !ps" >> input
    16.     echo "sim:applied-field-strength=1.0 !T" >> input
    17.     echo "sim:applied-field-unit-vector=1,0,0" >> input
    18.     echo "sim:fmr-field-strength = 0.0001 !T" >> input
    19.     echo "sim:fmr-field-frequency = $i.0" >> input
    20.     echo "sim:fmr-field-unit-vector = 0,1,0" >> input
    21.     echo "sim:program = fmr" >> input
    22.     echo "sim:integrator = llg-heun" >> input
    23.     echo "output:magnetisation" >> input

    24.     echo "frequency = $i.0 GHz"

    25.     mpirun -np 6 ~/vampire/vampire-parallel

    26.     cp output output_${i}GHz
    27.     cp input input_${i}GHz
    28. done
    The loop variable i counts the GHz's.
    Line 5 to 24 creates and fills out the new input file.
    Line 26 prints to the screen the frequency about to be simulated.
    Lines 28 runs the simulation (you may need to change this line).
    Finally, lines 30 and 31 copies the input and output files so that they are not overwritten or deleted in the next iteration.
  4. Before running this you need to use the command
        chmod +x frequencySweep.sh
    to make it executable.
  5. The frequency sweep is now started with the command
        ./frequencySweep.sh
  6. You would later need to extract the results from the output files. Plotting the traces one can see that it takes a little bit of time for the oscillations to stabilize. (See the left of attached image frequencySweep.png.)
  7. Taking the absolute maximum of the component of the magnetization parallel to the fmr field, max(|m_y|), we see a peak at low frequencies equal to the amplitude of the fmr field. A peak in max(|m_z|) shows where the response changes from quasistatic to dynamic. Be sure to exclude the beginning, where the oscillations haven't stabilized yet, when taking these maxima values. (See the right plot in the attached figure frequencySweep.png.)
:::: Finding resonance ::::

A saturated paramagnet should also show resonant behavior at some frequency, but I have not been able to find it. Therefore, we will reactivate the exchange and try to deal with the problems this leads to.
  1. Go into the material file Co.mat and reset the value of the exchange constant,
        material[1]:exchange-matrix[1] = 11.2e-21
  2. Rerun the frequency sweep and you will see a wild behavior when looking at the traces, and an 'absorption' vs frequency plot that doesn't make much sense at all. This wild behavior eventually dies out and turns into stable oscillations. To see this, increase the number of time steps to 20000 in frequencySweep.sh,
        echo "sim:total-time-steps = 20000" >> input
  3. (See the attached image frequencySweepWithExchange.png.)
    Zooming in on the traces even more one can see that there are higher frequency oscillations superposed onto the "Larmor oscillations". This is probably the spinning of the sublattices described earlier, which will be present now that exchange is turned back on.
  4. You could try changing the material or the static field strength but you might run into the same problem as me, namely that the peak doesn't seem to be affected by these things. (The attached file Fe.mat can be used together with setting the crystal structure to bcc and the unit cell size to 2.87 Å (and changing the system size accordingly), to compare these "Cobalt" results with bcc iron.)
:::: Problem number 2 -- wild initial oscillations ::::

Despite setting the initial spin direction to be along the static field, there is a wild initial behavior, meaning the simulations can take very long and contain a lot of unnecessary data. Setting the exchange to zero removes this problem, and it seemed both in simulations and my mind that there would be a resonance at the same frequency. (See comparison of simulation with exchange and the exact same simulation except with exchange set to 0, in the attached file exchangeVsNoExchange.png.) However, I have not found anything resembling resonance with the exchange turned off.

It would be very good if someone could explain the 'correct' way of avoiding at least most of these initial wild oscillations, or perhaps how one could tell vampire to not save data until a set amount of time steps had passed.

:::: Problem number 3 -- Where is the resonance? ::::

With bcc iron in a 1 T field the resonance should be around 42 GHz according to the Kittel equation, but in a fine sweep from 1 to 200 GHz with the exchange turned off, there is nothing resembling a resonance. (See the attached files bccFeZeroExchange_1to100GHz.png and bccFeZeroExchange_100to200GHz.png.)

The only thing I've found resembling a resonance is what was presented in the section "Finding resonance". Furthermore, in the section before that, where the same frequency sweep was performed with the exchange turned off, there was no such peak.

I doubt that the peak from the "Finding resonance" section actually is an fmr peak because such a peak should be sensitive to the static field and the material, but it barely moves even when increasing or decreasing the static field by an order of magnitude or when setting half the atomic spin moment.

:::: Outlook ::::

This is where I'm at. Stuck with mainly these three problems.

I hope what is presented above is enough for others to join in, to experiment and find out how things should be done. Maybe there are a lot of people doing fmr with Vampire, who can solve all of these problems by just describing how they do it. Hopefully we will eventually get a tutorial up on the Vampire website.
input
dynamicFilmNoExchangeAni.gif
frequencySweep.sh
frequencySweep.png
frequencySweepWithExchange.png
Fe.mat
exchangeVsNoExchange.png
bccFeZeroExchange_1to100GHz.png
bccFeZeroExchange_100to200GHz.png
quasistaticAni.gif
quasistatic.png
dynamic.png
dynamicAni.gif
dynamicFilm.png
spins80.png
spins81.png
dynamicFilmNoExchange.png

ace.h...@gmail.com

unread,
Jul 31, 2021, 1:35:23 PM7/31/21
to Vampire Users
tank you so much 

vito stanpo

unread,
Aug 26, 2021, 7:33:22 AM8/26/21
to Vampire Users
Good evening Milton  I have just watched your post in 2021. I was wondering because you are altering the frequency instead of applied magnetic field so that it is difficult finding the resonance. Because if FMR linewidth we are looking for we should be varying applied field strength. Please correct me if I'm wrong.

Best Regards,
 Vito

gabo...@gmail.com

unread,
Aug 26, 2021, 8:09:54 AM8/26/21
to Vampire Users
Vito,

It sounds like you are studying the FMR field swept linewdith like in FIG. 7 of the article titled "Ferromagnetic resonance linewidth in metallic thin films: Comparison of measurement methods" at [1].

Maybe Milton's frequency sweep is for studying the FMR frequency swept linewidth like in FIG. 8 of [1].


Kind Regards,

Gavin

Planck Max

unread,
Oct 21, 2021, 3:32:31 AM10/21/21
to Vampire Users
for sample ,we can re-write the code that calculating fmr-field ,the initial fmr-field H_fmr = sin(2*pi*w*t), if we replace the formual with H_fmr = sin(2*pi*w*t)/(2*pi*w*t) ,it will include all frenquency form -w to w, it is equal sweep frenquency

2.jpg8b2f7052b68aa3537815a6b0c82b7f0.png

Planck Max

unread,
Oct 21, 2021, 3:35:20 AM10/21/21
to Vampire Users
1.jpg

milton...@gmail.com

unread,
Nov 14, 2021, 9:22:24 AM11/14/21
to Vampire Users
Thanks for the replies!

Maybe you are right Vito, that it would be easier to find the resonance by sweeping field. Maybe the large sweep of frequencies only shows some background signal and the real peak is in there if one zoom in on the right range. Like Gavin said I was trying to find things like frequency linewidth, but if doing a field sweep means one can find the peak then one could switch back to frequency sweeps later.

Planck, you seem to have figured it out. Could you please explain how you got that nice looking peak, in the print-screen of the matlab figure? I mean what do your files and scripts look like?

/Milton
Reply all
Reply to author
Forward
0 new messages