Skip to content

Commit 142fc31

Browse files
Merge pull request #15 from UppASD/sld2
Sld2
2 parents dfb519e + a7d754d commit 142fc31

3 files changed

Lines changed: 121 additions & 21 deletions

File tree

content/sld/DimerSLD/DimerpuSLDcoupled/inpsd.dat

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ ll ./llfile.nosym
2020
mml ./mmlfile.nosym
2121
Initlatt 3
2222

23-
do_ld Y
24-
mode R
23+
do_ld Y # Read lattice and spin-lattice Hamiltonians
24+
mode R # Perform SLD simulation
2525
Nstep 20000
2626
timestep 1e-16
2727
damping 0.00
2828
lattdamp 0.00
2929
Temp 0.00
3030

31-
do_lavrg Y
31+
do_lavrg Y # Measurement of average displacaments
3232
do_proj_lavrg Y
3333
lavrg_step 10
3434
lavrg_buff 10
3535

36-
do_ltottraj Y
36+
do_ltottraj Y # Measurements of displacments
3737
ltottraj_step 10
3838
ltottraj_buff 10
3939

@@ -62,4 +62,12 @@ do_prn_binteff Y
6262
binteff_step 10
6363
binteff_buff 10
6464

65-
plotenergy 1
65+
ntraj 2 # Measurements of individual spin trajectories
66+
1 10 10
67+
2 10 10
68+
69+
lntraj 2 # Measurements of individual displacament trajectories
70+
1 10 10
71+
2 10 10
72+
73+
plotenergy 1 # Measurement of energies
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import numpy as np
2+
import matplotlib.pyplot as plt
3+
import matplotlib as mpl
4+
plt.style.use('default')
5+
plt.rc("figure", facecolor="white")
6+
7+
mtraj1=np.genfromtxt("trajectory.scnobase.001.1.out")
8+
mtraj2=np.genfromtxt("trajectory.scnobase.002.1.out")
9+
utraj1=np.genfromtxt("disptraj.scnobase.1.1.out")
10+
utraj2=np.genfromtxt("disptraj.scnobase.1.1.out")
11+
lattenergy=np.genfromtxt("lattenergy.scnobase.out")
12+
t0=0
13+
t1=2001
14+
15+
# Plot the spin trajectories
16+
fig_mtraj = plt.figure()
17+
ax1 = fig_mtraj.add_subplot(111)
18+
ax1.plot(mtraj1[t0:t1,0],mtraj1[t0:t1,2], c='r', linestyle='--',linewidth=2.0)
19+
ax1.plot(mtraj1[t0:t1,0],mtraj1[t0:t1,3], c='g', linestyle='--',linewidth=2.0)
20+
ax1.plot(mtraj1[t0:t1,0],mtraj1[t0:t1,4], c='b', linestyle='--',linewidth=2.0)
21+
ax1.axis('tight')
22+
#plt.xlim([-12,12])
23+
#plt.ylim([0,80])
24+
plt.xticks(fontsize=16)
25+
plt.yticks(fontsize=16)
26+
plt.legend(['mx', 'my', 'mz'], fontsize=16)
27+
plt.show()
28+
fig_mtraj.savefig('figmtraj1.png', format='png', dpi=100)
29+
30+
# Plot the displacement trajectories
31+
fig_utraj = plt.figure()
32+
ax1 = fig_utraj.add_subplot(111)
33+
ax1.plot(utraj1[t0:t1,0],utraj1[t0:t1,2], c='r', linestyle='--',linewidth=2.0)
34+
ax1.plot(utraj1[t0:t1,0],utraj1[t0:t1,3], c='g', linestyle='--',linewidth=2.0)
35+
ax1.plot(utraj1[t0:t1,0],utraj1[t0:t1,4], c='b', linestyle='--',linewidth=2.0)
36+
ax1.axis('tight')
37+
plt.xticks(fontsize=16)
38+
plt.yticks(fontsize=16)
39+
plt.legend(['ux', 'uy', 'uz'], fontsize=16)
40+
plt.show()
41+
fig_mtraj.savefig('figmtraj1.png', format='png', dpi=100)
42+
43+
# Plot the energies of the SLD Hamiltonian
44+
fig_etraj = plt.figure()
45+
ax1 = fig_etraj.add_subplot(111)
46+
# Iter. ld_potenrg sd_potenrg sld_potenrg totpot_enrg kin_enrg tot_enrg ionic temp
47+
ax1.plot(lattenergy[t0:t1,0],lattenergy[t0:t1,1], c='r', linestyle='--',linewidth=2.0)
48+
ax1.plot(lattenergy[t0:t1,0],lattenergy[t0:t1,2], c='g', linestyle='--',linewidth=2.0)
49+
ax1.plot(lattenergy[t0:t1,0],lattenergy[t0:t1,3], c='b', linestyle='--',linewidth=2.0)
50+
ax1.plot(lattenergy[t0:t1,0],lattenergy[t0:t1,5], c='m', linestyle='--',linewidth=2.0)
51+
ax1.plot(lattenergy[t0:t1,0],lattenergy[t0:t1,6], c='k', linestyle='--',linewidth=2.0)
52+
ax1.axis('tight')
53+
plt.xticks(fontsize=16)
54+
plt.yticks(fontsize=16)
55+
plt.legend(['LL', 'SS', 'SSL', 'KIN', 'TOT'], fontsize=16)
56+
plt.show()
57+
fig_etraj.savefig('figetraj.png', format='png', dpi=100)

content/sld/sld.rst

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,84 @@
11
Spin-lattice dynamics
22
=====================
33

4-
SLD simulation of a dimer
5-
-------------------------
4+
For ASD simulations, the minimal set of input files consists of ``inpsd.dat``, a ``posfile``,
5+
a ``momfile``, and a ``jfile``. In order to set up a SLD simulation with UppASD, this set of
6+
input files need to be augmented with a number of files, namely a ``phonfile``, an ``llfile``,
7+
and the coupling constants for a cross coupling Hamiltonian such as the third order
8+
spin-spin-displacement Hamiltonian contained in an ``mmlfile``.
9+
10+
In these exercises you will explore how a spin-lattice coupled systems can be set up for
11+
simulation with UppASD. The first two systems are a magnetic dimer and a magnetic trimer.
12+
For these systems input files are provided in two variants, either with the full set of
13+
interactions specified, or with only the irreducible set of interactions are specified.
14+
In the latter case the point group operations that are activated with the ``sym`` flag
15+
are used to work out the full set of couplings.
16+
17+
Exercise 1: SLD simulation of a dimer
18+
-------------------------------------
19+
620
In this example we are modeling a spin-lattice coupled magnetic dimer, with zero lattice
721
damping and zero Gilbert damping, using velocity-Verlet or fixed-point iteration
822
implicit midpoint solver. The full expressions for the Hamiltonian, the effective magnetic
923
fields, and the interatomic forces are contained in Eqs. 27-31 in Ref. [Hellsvik2019]_.
1024

11-
The main input file ``inpsd.dat``
25+
The main input file ``inpsd.dat`` contains a number of additional blocks
1226

1327
.. literalinclude:: DimerSLD/DimerpuSLDcoupled/inpsd.dat
1428

15-
the ``posfile`` The file contains the positions of the atoms in terms of basis vector coordinates in the unit cell.
29+
The ``posfile`` contains the positions of the atoms in terms of basis vector coordinates in the unit cell.
1630

1731
.. literalinclude:: DimerSLD/DimerpuSLDcoupled/posfile
1832

19-
the ``momfile`` The file contains the magnetic moments of the atoms in the unit cell.
33+
The ``momfile`` contains the magnetic moments of the atoms in the unit cell.
2034

2135
.. literalinclude:: DimerSLD/DimerpuSLDcoupled/momfile
2236

23-
the ``jfile.nosym`` The file contains the exchange couplings within the system.
37+
The ``jfile.nosym`` contains the exchange couplings within the system.
2438

2539
.. literalinclude:: DimerSLD/DimerpuSLDcoupled/jfile.nosym
2640

27-
The ``phonfile`` File contains ionic masses, initial displacements and velocities. The columns are : site number, atom type, atomic mass, initial displacements and velocities in three different directions x, y, z.
41+
The ``phonfile`` file contains ionic masses, initial displacements and velocities.
42+
The first column is the ``site`` number, the second the atom ``type``,
43+
the third the ``atomic mass`` in atomic mass units, the 4-6th the Cartesian components
44+
of the initial displacements, the 7-9th columns the Cartesian components of the velocities.
2845

2946
.. literalinclude:: DimerSLD/DimerpuSLDcoupled/phonfile
3047

31-
The ``llfile.nosym`` File contains the harmonic force constants for a lattice. The columns are : site number, (not used), interaction vectors depending on maptype, 9 components of the harmonic force constants in the order of [xx, xy, xz, yx, yy, yz, zx, zy, zz].
48+
The ``llfile`` file contains the harmonic force constants.
49+
The first column is the ``site`` number, (not used), the 3rd-5th the interaction vectors
50+
(dependent on ``maptype``), and the 6-15th columns the components of the harmonic force
51+
constants in the order of *xx*, *xy*, *xz*, *yx*, *yy*, *yz*, *zx*, *zy*, *zz*.
3252

3353
.. literalinclude:: DimerSLD/DimerpuSLDcoupled/llfile.nosym
3454

35-
The ``mmlfile.nosym`` File contains the spin-lattice coupling (SLC) constants [see Eqs. 6-9 in Ref. [Hellsvik2019]_]. The columns from first row are : site number (atom i), site number of nearest neighbour mapping (atom j), interaction vectors for nearest neighbour site (j-th) and displaced (k-th) atom depending on maptype. The columns from the second, third and fourth rows are : 9 components of SLC constants for the displacement of k-th atom along x, y, z respecively. The ordering of SLC components in each row are [xx, yx, zx, xy, yy, zy, xz, yz, zz]. For DimerSLD, the SLC constants are of :math:`A_{iji}` type.
55+
The ``mmlfile`` contains the spin-lattice coupling (SLC) constants
56+
[see Eqs. 6-9 in Ref. [Hellsvik2019]_]. The columns from first row are:
57+
site number (atom i), site number of nearest neighbour mapping (atom j),
58+
interaction vectors for nearest neighbour site (j-th) and displaced (k-th)
59+
atom depending on maptype. The columns from the second, third and fourth rows are:
60+
9 components of SLC constants for the displacement of k-th atom along x, y, z respectively.
61+
The ordering of SLC components in each row are [xx, yx, zx, xy, yy, zy, xz, yz, zz].
62+
For a dimer, the SLC constants are of :math:`A_{iji}` type, *i.e.* the displacement is always
63+
on one of the two atoms that are exchange coupled, given that no third site is present.
3664

3765
.. literalinclude:: DimerSLD/DimerpuSLDcoupled/mmlfile.nosym
3866

39-
SLD simulation for trimer
40-
-------------------------
41-
TrimerSLD # Trimer SLD, atomic units, with different MML coupling,
42-
# either of :math:`A_{iji}` type or of :math:`A_{ijk}` type.
43-
# optional use of point group symmetries for the couplings
67+
* Run a simulation for the example ``DimerSLD/DimerpuSLDcoupled``. Which output files are generated?
68+
* Plot the time trajectories of the energies that are written to the file ``lattenergy.scnobase.out``. How do the energies evolve in time? Compare for Fig. 2 in [Hellsvik2019]_. Use the sccript ``plotTrajDimerSLD.py``.
69+
* Plot the time trajectories of spins (``trajectory.scnobase.001.1.out``, ``trajectory.scnobase.002.1.out``), and displacements (``disptraj.scnobase.1.1.out``, ``disptraj.scnobase.2.1.out``). How do magnetic precession frequencies evolve in time? Compare for Fig. 3 in [Hellsvik2019]_.
70+
* Compare the input files contained in ``DimerSLD/DimerpuSLDcoupledSym`` with ``DimerSLD/DimerpuSLDcoupled``. How do they differ? Verify that the same Hamiltonians are set up within the UppASD simulation by comparing the ``struct.scnobase.out``, the ``lldata.scnobase.ou``, and the ``mmldata.scnobase.out`` files for the two different cases.
71+
72+
Exercise 2: SLD simulation for trimer
73+
-------------------------------------
74+
75+
* Run a simulation for the example ``TrimerSLD/TrimerauSLD3site``.
76+
* Modify the plot script ``plotTrajDimerSLD.py`` that was used for the dimer, so that it can be used for the trimer.
77+
* Run a simulation for the example ``TrimerSLD/TrimerauSLD3siteSym``. Compare the input files contained in ``TrimerSLD/TrimerauSLD3siteSym`` with ``TrimerSLD/TrimerauSLD3site``. How do they differ?
78+
79+
Exercise 3: Phonon and magnon spectra for bcc Fe
80+
------------------------------------------------
4481

45-
bcc Fe
46-
------
4782
bccFeSLD # bcc Fe with MM, LL and MML coupling. Uses cutoff in LL interaction
4883

4984
# Variants available in the runbccFe*.sh scripts

0 commit comments

Comments
 (0)