udkm1Dsim -- A Python toolbox for simulating 1D ultrafast dynamics in condensed matter
uudkm1Dsim - A Python toolbox for simulating 1D ultrafast dynamics incondensed matter
Daniel Schick ∗ Max-Born-Institut f¨ur Nichtlineare Optik und Kurzzeitspektroskopie, Max-Born-Straße 2A, 12489 Berlin, Germany
Abstract
The udkm1Dsim toolbox is a collection of Python classes and routines to simulate the thermal, struc-tural, and magnetic dynamics after laser excitation as well as the according X-ray scattering response inone-dimensional sample structures. The toolbox provides the capabilities to define arbitrary layered struc-tures on the atomic level including a rich database of element-specific physical properties. The excitationof dynamics is represented by an N -temperature-model which is commonly applied in ultrafast physics.Structural dynamics due to thermal stresses are calculated by a linear-chain model of masses and springs.The implementation of specific magnetic dynamics can be easily accomplished by the user employing ageneralized magnetization interface class. The resulting X-ray diffraction response is computed by kine-matical or dynamical X-ray theory which can also include polarization-dependent magnetic scattering. The udkm1Dsim toolbox is highly modular and allows for injecting user-defined inputs at any step within thesimulation procedure. Keywords: ultrafast dynamics, multilayer absorption, heat diffusion, N -temperature model, coherentphonons, magnetization dynamics, thermoelasticity, magnetoelasticity, kinematical X-ray scattering,dynamical X-ray scattering, dynamical magnetic X-ray scattering ∗ Corresponding author.
E-mail address: [email protected]
Preprint submitted to Computer Physics Communications February 26, 2021 a r X i v : . [ phy s i c s . c o m p - ph ] F e b ROGRAM SUMMARY
Program Title: udkm1Dsim
CPC Library link to program files: (to be added by Technical Editor)
Developer’s repository link: https://github.com/dschick/udkm1Dsim
Code Ocean capsule: (to be added by Technical Editor)
Licensing provisions(please choose one):
MIT
Programming language:
Python
Journal reference of previous version:
Computer Physics Communications Volume 185, Issue 2, February 2014,Pages 651-660
Does the new version supersede the previous version?: yes
Reasons for the new version:
The toolbox has been ported from
MATLAB (MathWorks Inc.) to Python and isbased exclusively on free and open-source components. Moreover, new features have been added that allow for abroader applicability of the toolbox.
Summary of revisions:
Porting to Python.Introduction of amorphous layers in the sample structures.Add magnetization property to atoms and layers.Multilayer formalism to calculate laser absorption.New magnetization class to allow for user-defined magnetization dynamics.New resonant magnetic X-ray scattering employing dynamical X-ray theory.Calculation of X-ray scattering as function of photon energy and scattering vector.
Nature of problem(approx. 50-250 words):
Simulate the thermal, structural, and magnetic dynamics of 1D samplestructures due to an ultrafast laser excitation and compute the corresponding transient (magnetic) X-ray scatteringresponse.
Solution method(approx. 50-250 words):
The program provides an object-oriented toolbox for building arbitrarylayered 1D crystalline/amorphous sample structures including a rich database of element-specific parameters. Theexcitation, thermal transport, and lattice dynamics are simulated utilizing SciPy’s ODE solver. Magnetizationdynamics can be introduced by the user employing a magnetization interface class. The dynamical (magnetic) X-rayscattering is computed by a matrix formalism that can be parallelized.
Additional comments including restrictions and unusual features (approx. 50-250 words):
The program is restrictedto 1D sample structures. Phonon dynamics only include longitudinal acoustic phonons (sound waves). Magnetizationdynamics have to be defined by the user. X-ray scattering only allows for symmetrical and co-planar geometries dueto the 1D nature of the toolbox. The program is highly modular and allows the inclusion of user-defined inputs atany time of the simulation procedure. . Introduction The investigation of electronic, magnetic, andstructural dynamics in solid state physics has madegreat progress during the last decades due to the in-creasing availability of ultrashort electron and lightpulses in a broad spectral range from THz to hardX-rays at large-scale facilities as well as in the lab.One of the major goals of these experiments is to fol-low the coupling of different degrees of freedom onthe relevant time and length scales. Recent examplesreveal the complexity of these experiments even forfollowing only two sub-systems, such as the couplingof electron and lattice dynamics [1, 2, 3], of electronand spin dynamics [4, 5, 6], or the coupling of spinand lattice dynamics [7, 8, 9].In order to understand and interpret such ex-perimental data, one relies on a bunch of simula-tions for modeling and fitting, which are availableas software tool-kits or as published formalisms. Alist of required dynamic simulations might includethe simplistic N -temperature model (NTM) as ini-tially proposed by Anisimov et al. [10] as well asits modifications and implementations [1, 11, 12],coherent phonon dynamics in a masses-and-springmodel [13, 14], molecular dynamics for simulationsof spin lattice coupling [15, 16], magnetic simulationscombining a 2-temperature-model with the Landau-Lifschitz-Bloch equation [17], or full magnetic simu-lations [18, 19, 20, 21]. Other aspects can be the spa-tial absorption profile of the laser excitation in thesample [22, 23] and, moreover, the calculation of theactual observable, e.g. the scattered light intensity inthe framework of kinematical or dynamical scatteringtheories [24, 25, 26, 27, 28, 29] with possible inclu-sion of resonant and magnetic scattering effects. Theimplementation of the above mentioned formalismsor the usage and adaption of available external soft-ware packages is very time-consuming and each pieceof software covers only a very limited aspect of realtime-resolved experiments. To that end, the needfor a generic, modular, and open-source toolbox thatallows for combining many of the above mentionedfunctionalities is obvious.The udkm1Dsim toolbox allows to create arbi-trary one-dimensional (1D) structures made of crys- talline and/or amorphous layers, including stochio-metric mixtures, typically on the nanometer length-scale. These 1D structures hold all relevant materialinformation such as structural, elastic, thermal, mag-netic, and optical parameters. The toolbox allowsfor calculating thermal, structural, and magnetic dy-namics on these 1D structures utilizing an NTM, alinear masses-and-springs-model, as well as an inter-face for user-defined magnetization dynamics, respec-tively. Finally, different types of light-scattering the-ories can be applied to retrieve the static as wellas transient response from these sample structuresdue to the above mentioned dynamics, similar to realpump-probe experiments. With that the generallynon-linear dependence of the actual observable (scat-tered light intensity) and the physical quantity of in-terest (temperature, strain, magnetization, ...) canbe revealed. This includes also methods to apply real-istic instrumental broadening to the simulated resultsfor better comparison with experimental data. Fornow the udkm1Dsim toolbox focus on light scatter-ing from the extreme ultra-violet (XUV) up to hardX-rays but can be easily extended to larger wave-length radiation or totally different probing tech-niques that can be modeled in 1D.The original matlab (MathWorks Inc.) udkm1Dsim toolbox [30] has been successfullyused in 40 publications (Feb. 2021) and is still avail-able for download [31]. However, due to Python’sincreasing performance, popularity, and availabil-ity the new version of the udkm1Dsim toolboxhas been ported to this programming language.At the same time, the project has moved to github.com/dschick/udkm1Dsim to provide fullversion control, issue, and feature tracking, as well asproject management capabilities in order to allow forbetter collaboration between users and developers.This also includes automatic code validation and unittesting, as well as source-code-based generation ofthe documentation at udkm1Dsim.readthedocs.org as part of the continuous integration (CI) concept.Despite of the major step of porting the udkm1Dsim toolbox to Python there are several newfeatures included in this release while only a few mi-nor features of the old version have been dropped.Accordingly, existing simulations in matlab (Math-3orks Inc.) are easily portable to this new Pythonversion as the general concept and syntax of the tool-box has been unaffected. The new functionalities ofthe release include: the introduction of amorphouslayers in addition to crystalline unit cells; magneticproperties of atoms including magnetic scattering fac-tors; a multilayer formalism for calculating laser ab-sorption profiles [22, 23]; a new magnetization dy-namics module; a dynamical magnetic scattering for-malism [28]; as well as a unified interface to calculatelight scattering as function of scattering vector andphoton energy.Most of the underlying physics has already been de-scribed in the initial version of the udkm1Dsim tool-box [30] as well as in the API documentation of thecorresponding modules. Therefore we will concen-trate mainly on the new features/physics as well as onthe slight changes of the workflow in Python. After ageneral description of the implementation and work-flow of the udkm1Dsim toolbox, we will introducethe new release features within an exemplary simu-lation of laser-induced dynamics in a magnetically-coupled superlattice of Fe and Cr layers.As a convention throughout this document all codeis written in typewriter font ( code = [1, 2, 3] ).
2. Implementation & Workflow
The structure of the udkm1Dsim toolbox as aPython module tries to reflect the physical realityof the modelled experiments, see Fig. 1. In the be-ginning a
Structure object needs to be build out ofany number and combination of
AmorphousLayer and/or
UnitCell objects which themselves need to consist ofone or more
Atom / AtomMixed objects. The
Structure holds all relevant physical parameters which are re-quired for the actual static and dynamic simulations.Within the simulations module different types of dy-namic simulations can be carried out on the
Structure object, e.g.
Heat, PhononNum/Ana, Magnetization simula-tions.In general, the
Heat class models the laser-excitation and the resulting energy-flow by an NTM.The resulting phonon and magnetization dynam-ics can be calculated sequentially or in any user-defined class, that allows for coupling of the dif- atoms
AtomAtomMixed layers
AmorphousLayerUnitCell structure
Structure heat
Heat phonons
PhononNumPhononAna magnetization
Magnetization xrays
XrayKin XrayDyn XrayDynMag structures module simulations module
Figure 1: Workflow of the udkm1Dsim toolbox. (Sub-)Modulenames are italic and class names are in bold letters. All classesof the simulations module require a
Structure object on ini-tialization. ferent degrees of freedom. The modular structureof the in- and outputs of the simulation classes al-low for easy exchange or alteration of the simula-tion results with user-defined data or external cal-culations. The classes of the xray module allowfor calculation of static symmetric X-ray scatteringfrom the given sample
Structure as function of pho-ton energy, scattering vector, as well as of light po-larization. In addition, the results from the dy-namic
Heat, PhononNum/Ana, Magnetization simulationscan be input to the X-ray scattering calculation inorder to retrieve the dynamic scattering responseof the excited sample. This functionality of the udkm1Dsim toolbox is of major importance, sincethe transient change of the actual physical quantityof interest, such as strain or magnetization, must notbe proportional to the actual observable - the scat-tered light intensity.The common experimental scheme is sketched inFig. 2 and shows the general definition of coor-dinates and angles that are used throughout the udkm1Dsim toolbox. Due to the limitation to 1Dsample structures the scattering plane must be co-planar to the sample surface and only symmetricalscattering with a scattering vector (cid:126)q z = (cid:126)k out − (cid:126)k in x z ϑ k in q z k out γ ϕ m sample structure scattering planemagn.plane Figure 2: Experimental scheme of the udkm1Dsim toolbox.The co-planar scattering plane contains the scattering vector (cid:126)q z = (cid:126)k out − (cid:126)k in . The magnetization (cid:126)m of the individual Atom objects can be defined in 3D by an amplitude and the accordingangles γ and φ . The out-of-plane coordinate z points awayfrom the sample surface. can be calculated in the X-ray simulations. Here thenorm of the scattering vector q z = πλ sin ϑ is definedby the X-ray wavelength λ and the incidence angle ϑ . The multilayer absorption uses the same defini-tion as shown in Fig. 2 for the laser incidence angle.The magnetization (cid:126)m of each Atom is defined by the ac-cording angles γ and φ . The magnetization can pointinto all directions in 3D in order to allow for any over-lap with the incident X-ray polarization. Since thesample structure is defined from top to bottom thedistances within the sample start at its surface andproceed along − z direction.All classes of the simulations module share an ad-vanced caching mechanism which allows to save com-putationally heavy results to a user-defined path forlater reuse. If enabled, the individual simulationsgenerate a unique hash for only the relevant physi-cal parameters that affect the requested calculation.The result of the calculation will then be saved andtagged with this unique hash. It will be automati-cally reloaded if the simulation is carried out againwith the exact same parameter set.The udkm1Dsim toolbox fully relies on SI unitswithin its internal calculations. However, the exter- nal user interface allows to define all relevant param-eters as physical quantities using the Pint package[32]. Accordingly, the unit conversion to proper SIunits will be done automatically within the code. Ifno units are defined, parameters are assumed to bealready in SI units.
3. Example
We choose to simulate the laser-driven structuraland magnetic dynamics in an antiferromagnetically(AFM) coupled Fe/Cr superlattice (SL) [33] as anexample to demonstrate the recent capabilities of the udkm1Dsim toolbox. The test sample consists of20x(Fe+Cr) on a Si substrate with a layer thicknessof d Fe = d Cr = 1 nm. In the Fe/Cr SL the individualFe layers are ferromagnetically aligned in the plane ofthe sample. In dependence of the Cr layer thicknessthe adjacent Fe layers can align anti-parallel to eachother [34]. Generally so-called SL Bragg peaks willappear in the X-ray diffraction due to the artificialperiodicity of an Fe/Cr doublelayer (DL) [35]. Forthe special case of resonant magnetic scattering, e.g.at the Fe L and L edges, the doubled AFM peri-odicity of two DLs is observable and leads to puremagnetic Bragg peaks at half order of the structuralBragg peaks [36].The AFM Fe/Cr SL is already a very complex ex-ample and the udkm1Dsim toolbox will be far fromcovering all involved dynamics here. However, it canprovide important insights into the laser excitationusing the multilayer absorption formalism, the energytransport on ultrafast timescales using a heat diffu-sion model, resulting coherent acoustic phonons dueto thermal stresses, and a simplified demagnetiza-tion model due the laser-driven temperature increase.Moreover, the resulting magnetic X-ray scattering re-sponse allows for a direct comparison between exper-iment and simulations.After successful installation of the udkm1Dsim toolbox, it can be easily importedin any Python script or Jupyter notebook: import udkm1Dsim as udu = ud.u u is the so-called unit-registry based on the Pint package [32] which is used internally in the toolboxand must be used externally to allow for physicalquantities and automatic unit conversion.
In the first step the
Atom and
AmorphousLayer objectsare created to build the sample
Structure : Fe_right = ud.Atom('Fe', mag_amplitude=1,mag_phi=90*u.deg, mag_gamma=90*u.deg,atomic_form_factor_path='./Fe.cf')Fe_left = ud.Atom('Fe', mag_amplitude=1,mag_phi=90*u.deg, mag_gamma=270*u.deg,atomic_form_factor_path='./Fe.cf')Cr = ud.Atom('Cr')Si = ud.Atom('Si')
The two atoms
Fe_left and
Fe_right represent thetwo different anti-parallel magnetization states in thesample. The parameters mag_amplitude , mag_phi , and mag_gamma define the magnitude and pointing of the Femagnetization in accordance to Fig. 2. Here the mag-netization can be understood as the so-called macro-spin as within the Landau-Lifschitz-Bloch theory[17], that allows for a temperature-dependent vari-ation of the magnetization amplitude. The element-specific atomic scattering factors are taken from theChantler [37] or Henke [38] tables which are both in-cluded in the toolbox. The magnetic form factorsare taken from the Dyna project [39]. In case an atomic_form_factor_path or magnetic_form_factor_path toa user-defined data file is given, the according valueswill be used instead. Layer objects of Fe, Cr, and Si as substrate materialare initialized as amorphous layers and by providinga dictionary of the relevant physical parameters: prop_Fe = {}prop_Fe['heat_capacity'] = 449*u.J/u.kg/u.Kprop_Fe['therm_cond'] = 80*u.W/(u.m *u.K)prop_Fe['lin_therm_exp'] = 11.8e-6prop_Fe['sound_vel'] = 4.910*u.nm/u.psprop_Fe['opt_ref_index'] = 2.9174+3.3545jlayer_Fe_left = ud.AmorphousLayer('Fe_left','Fe left amorphous', thickness=0.2*u.nm,density=7874*u.kg/u.m**3, atom=Fe_left, **prop_Fe)layer_Fe_right = ud.AmorphousLayer('Fe_right','Fe right amorphous', thickness=0.2*u.nm,density=7874*u.kg/u.m**3, atom=Fe_right, **prop_Fe) ...layer_Cr = ud.AmorphousLayer('Cr', "Cr amorphous",thickness=0.2*u.nm, density=7140*u.kg/u.m**3,atom=Cr, **prop_Cr)layer_Si = ud.AmorphousLayer('Si', "Si amorphous",thickness=0.2*u.nm, density=2336*u.kg/u.m**3,atom=Si, **prop_Si)
The thickness of the basic Fe and Cr layers is chosento be only 0.2 nm in order to allow for a finer spa-tial grid for the ordinary differential equation (ODE)solvers in the dynamics simulations. The sample
Structure is created of a nested double-layer
Structure which allows to simplify rather complex sample ge-ometries:
S = ud.Structure('Fe/Cr AFM Super Lattice')
DL = ud.Structure('Two Fe/Cr Double Layers')DL.add_sub_structure(layer_Fe_left, 5)
DL.add_sub_structure(layer_Cr, 5)
DL.add_sub_structure(layer_Fe_right, 5)
DL.add_sub_structure(layer_Cr, 5)
S.add_sub_structure(DL, 10)S.add_sub_structure(layer_Si, 500)
The sample
Structure can be easily visualized by thecommand
S.visualize() , see Fig. 3
All transient simulations of the udkm1Dsim tool-box need a spatial and temporal grid defined in thebeginning: delays = numpy.r_[-1:20:0.1]*u.ps_, _, distances = S.get_distances_of_layers()
Here one can freely choose the temporal grid whilethe spatial grid is generally given by the sample geom-etry which can be easily accessed from the
Structure object itself.
In order to simulate the laser-driven dynamics, weneed to initialize a
Heat object first and set all relevantexcitation parameters. h = ud.Heat(S, True)h.excitation = {'fluence': [20]*u.mJ/u.cm**2,'delay_pump': [0]*u.ps,'pulse_width': [0.1]*u.ps,
25 50 75 100 125 150 175
Distance [nm]
Fe_left Cr Fe_right Si
Figure 3: Automatic visualization of the AFM-coupled Fe/Cr SL
Structure . The blue and green regions indicate left and right magnetized Fe layers, respectively. The orange and red regions indicate Cr and Si layers, respectively. The distances withinthe
Structure are along the − z coordinate. 'multilayer_absorption': True,'wavelength': 800*u.nm,'theta': 45*u.deg}h.heat_diffusion = True The fluence F incident has to be input for normal inci-dence . For the projection of the laser onto the sam-ple surface, the angle of incidence ϑ is automaticallytaken into account, which is for ϑ = 45 ◦ about 70 %of F incident . In order to calculate the laser absorptionprofile, the user can either enable a multilayer ab-sorption formalism [22, 23] or use the Lambert-Beerformula as fall-back. Depending on the complexityof the sample geometry and the variation of the com-plex refractive index, the difference in the differentialabsorption d A /d z between both algorithms can besignificant, see Fig. 4. The Lambert-Beer formulaalso neglects any reflection from the sample surface,while the multilayer formalism includes even multiplereflections inside the sample. For the current samplethe optical reflectivity is about 48 % and the trans-mission is about 10 %. From these parameters onecan calculate that the absorbed fluence in the sampleis only about F abs /F incident = 29 %.The calculation of the 1D heat diffusion equationon the above defined sample structure can then besimply called by: temp_map, delta_temp_map = h.get_temp_map(delays,300*u.K) Here the second argument of the get_temp_map() method is the homogeneous initial temperature ofthe sample which could be also an array containinginitial temperatures for all individual layers. Theresulting spatio-temporal temperature map of thesample is shown in Fig. 5. In the background the udkm1Dsim toolbox will also take care of sufficient
Distance [nm] D i ff e r e n t i a l A b s o r p t i o n [ n m ] Fe/Cr Si substrate
MultilayerLambert-Beer
Figure 4: Differential absorption calculation comparing theLambert-Beer law vs. the multilayer formalism. Despite in-ternal multi-reflections, the multilayer formalism also includesreflection from the front surface of the sample. The absorptioncontrast between Fe and Cr layers is significantly different forboth methods. spatial and temporal interpolation at layer interfacesand pump events in order to improve the performanceof the ODE solver dramatically. This includes alsothe separation of temporal regions, that do not re-quire the calculation of heat diffusion because fullequilibrium conditions (no temperature gradients, noexcitation, isolating boundary conditions). More ad-vanced settings like boundary conditions, multipulseexcitations, or ODE settings can be found in the ac-cording examples of the udkm1Dsim toolbox.
Using the above calculated temp_map and its tempo-ral derivative delta_temp_map it is easily possible to cal-culate the coherent acoustic phonon dynamics withinthe same sample
Structure by using the numericalsolver for the masses-and-spring model implemented7
50 100 150
Distance [nm] T e m p e r a t u r e [ K ] (a) Fe/Cr Si substrate 0 ps 5 ps10 ps15 ps50 100 150
Distance [nm] D e l a y [ p s ] (b)
300 K500 K700 K900 K1100 K1300 K
Figure 5: Spatio-temporal temperature map after laser exci-tation. The line-outs in (a) and the full color-coded map inpanel (b) represent the relaxation of the laser-induced temper-ature gradient between absorptive Fe and Cr layers and thetransparent Si substrate. Due to the finite laser pulse widthof 100 fs the small temperature gradients between Fe and Crlayers within the first 40 nm are immediately relaxed. in the
PhononNum class: p = ud.PhononNum(S, True)strain_map = p.get_strain_map(delays,temp_map,delta_temp_map)
The resulting strain_map represents the strain for ev-ery layer at every delay point of the
Heat simulation,see Fig. 6.The map features complex oscillatory structuresdue to the excitation of so-called SL optical phononmodes or zone-folded acoustical phonons (ZFLAPs)[14] within the Fe/Cr region. These spatial and tem-poral oscillations of the strain are also imprinted onthe bi-polar strain wave that is launched into the Sisubstrate at later delays. One can easily read thesound velocity of Si from the slope of the color gradi-ent in Fig. 6 (b) as about 8 nm/ps. More details on
Distance [nm] S t r a i n [ % ] (a) Fe/Cr Si substrate 3.0 ps12.0 ps20.0 ps50 100 150
Distance [nm] D e l a y [ p s ] (b) -1.00%-0.50% 0.00% 0.50% 1.00% Figure 6: Spatio-temporal strain map due to the laser-excitation of coherent acoustic phonons. The full map in (b)features a complex pattern of SL phonons mode within thefirst 40 nm of the sample with tensile strain amplitudes ofmore than 1.0 %. Panel (a) shows the bi-polar strain wavethat is launched from the SL into the substrate at later delays.The bi-polar strain wave features additional oscillations thatstem from the SL geometry. the ODE settings, phonon damping, and non-linearphonon propagation can be found in the accordingexamples of the udkm1Dsim toolbox.
The simulation of magnetization dynamics isa rather complex topic on its own and the udkm1Dsim toolbox is currently not meant to pro-vide any high-profile code here. Optionally, we pro-vide an example of the microscopic 3-temperature-model by Koopmans et al. [11] in the documentation.This model provides decent fits of the average mag-netization amplitude for the early delays after pho-toexcitation but already neglects thermal transportby phonons. Instead of implementing complex spindynamics simulations here, we decided to provide a8eneric interface to inject results from external mag-netization dynamic calculations [40, 17, 18, 20, 19, 15]or to easily add user-defined code. For that we pro-vide the
Magnetization interface class. By inheritingfrom this interface class the user can reuse all fea-tures of the
Simulation class, such as caching, andonly needs to overwrite the calc_magnetization_map() method. This method can have the temp_map and strain_map as inputs and can access all properties ofthe sample
Structure . Its return value must be a magnetization_map , which contains the magnetizationamplitude and direction ( γ and φ in radians), seeFig. 2, for every layer at every delay of the dynamicsimulation.As an example we employ the Bloch formula, c.f.Eq. 1, to calculate the spontaneous magnetization M as function of the layer temperature T for every delay. M ( T ) = M ((1 − ( T /T C ) α ) β ) (1)We use the parameters T C = 770 K, α = 3 / β =0 .
32 and set M such that M (300 K ) = 1. Runningthe calculation is accomplished by: mag = Magnetization(S, True)magnetization_map = mag.get_magnetization_map(delays, strain_map=strain_map, temp_map=temp_map) The amplitude of the resulting magnetization_map isshown in Fig. 7.
In the last step we are going to calculate the staticresonant magnetic scattering response of the sam-ple before we use the strain_map and magnetization_map from the calculations above to simulate a dynamicalscattering response similar to a real pump-probe ex-periment. The xray module of the udkm1Dsim tool-box currently includes three different X-ray scatter-ing formalisms. A kinematical and dynamical X-rayscattering formalism is implemented in the
XrayKin and
XrayDyn classes, respectively. They work onlyfor crystalline unit cells and do not include mag-netic scattering effects. Therefor we use here the dy-namical magnetic formalism of the
XrayDynMag class,which is one of the most important new features ofthe udkm1Dsim toolbox. This formalism has beenadapted form the open-source Dyna Project [39, 28]
300 400 500 600 700 800 900
Temperature [K] M a g n e t i z a t i o n [ % ] (a)
50 100 150
Distance [nm] D e l a y [ p s ] (b)
0% 25% 50% 75% 100%
Figure 7: Spatio-temporal map of the magnetization ampli-tude. The magnetization amplitude of the Fe layers is com-pletely quenched for high local temperatures above T C =770 K. and was further improved by adding parallelizationfeatures, increasing the vectorization, and allowingfor simultaneous energy- and q z -dependent calcula-tion of the reflectivity and transmissivity for bothamorphous layers and crystalline unit cells. For thelater case no Bragg peaks from mono-atomic unitcells can be calculated as the Dyna formalism relieson scattering differences between adjacent layers.In order to perform resonant magnetic scatteringsimulations the atomic and magnetic form factorsneed to be carefully determined. This is usually doneby measuring the dichroic absorption of circularly po-larized light for the ferromagnetic state of the accord-ing element across the resonances of interest. Theaverage and difference spectra can then be carefullycalibrated and scaled to theoretical values [37, 38] inorder to determine the absorptive parts f and m .By applying the Kramers-Kronig-relation the refrac-tive contributions f and m can be retrieved as well.This procedure is currently not within the scope of9
90 700 710 720 730
Energy [eV] A t o m i c F o r m F a c t o r (a) f f
690 700 710 720 730
Energy [eV] M a g n e t i c F o r m F a c t o r (b) m m Figure 8: Energy-dependence of the refractive f , m and ab-sorptive f , m parts of the atomic and magnetic form factorsof Fe. the udkm1Dsim toolbox but can be easily achievedwith other free packages [41, 42]. Figure 8 showsthe atomic and magnetic form factors for the currentsimulations.The reflected intensity R of the static samplefor a given range of photon energies and scat-tering vectors q z can be easily calculated by the homogeneous_reflectivity() method of the XrayDynMag class: dyn_mag = ud.XrayDynMag(S, True)dyn_mag.energy = numpy.r_[690:730:0.1]*u.eVdyn_mag.qz = numpy.r_[0.01:5:0.01]/u.nmR, _, _, _ = dyn_mag.homogeneous_reflectivity()
The resulting scattering map is shown in Fig. 9 andfeatures a strong structural SL Bragg peak around q SL1 z = 3 .
13 nm − for all photon energies. The purelyAFM Bragg peaks around q SL0.5 z = 1 .
56 nm − and q SL1.5 z = 4 . − appear only at the Fe L and L resonances which provide magnetic contrast.To verify the magnetic origin of the AFM Braggpeaks we conduct a polarization analysis within the q z [nm ] R e f l e c t i v i t y (a) SL0.5 SL1 SL1.5690 eV708 eV720 eV1 2 3 4 5 q z [nm ] E n e r g y [ e V ] (b) Figure 9: Energy and q z -dependent scattering from the AFM-coupled Fe/Cr superlattice. Selected line-outs from panel (b)before as well as at the L and L resonances of Fe are shownin panel (a). The AFM Bragg peaks only appear on-resonanceat q SL0.5 z = 1 .
56 nm − and q SL1.5 z = 4 . − , while thestructural Bragg peak is present for all energies at q SL1 z =3 .
13 nm − . dynamical magnetic X-ray scattering simulations.Figure 10 compares three different analyzer settingsfor fixed σ polarization of the incident X-rays. Whilenormal charge scattering is not altering the polariza-tion of the scattered light, this is not true for mag-netic scattering. Accordingly, without analyzer bothcharge and magnetic scattering are included as inFig. 9 before, the σ → σ channel only includes chargescattering and the σ → π channel only includes mag-netic scattering. As expected, the AFM Bragg peaksdo not appear in the σ → σ channel. Due to the sym-metric layer thicknesses in the SL also even orders ofthe AFM Bragg peak are forbidden in the σ → π channel.10 q z [nm ] R e f l e c t i v i t y unpolarized Figure 10: Polarization dependence of magnetic X-ray scatter-ing from the Fe/Cr SL at 708 eV. The σ → σ channel only in-cludes charge scattering and the σ → π channel only magneticscattering. Without analyzer both contributions are included. In the last step we calculate the dynamic re-sponse of the sample due to the above calcu-lated spin and lattice dynamics, providing the magnetization_map and strain_map as inputs to the inhomogeneous_reflectivity() method of the
XrayDynMag class:
R_seq, _, _, _ = dyn_mag.inhomogeneous_reflectivity(strain_map = strain_map,magnetization_map=magnetization_map)
The result around SL1.5 at 720 eV is shown in Fig. 11.Due the quasi-instantaneous demagnetization, as in-put by the magnetization_map , the AFM Bragg peakintensity is quenched and recovers on a 10 ps timescale. At the same time coherent acoustic phonondynamics lead to an obvious shift of the magneticBragg peak and the structural Laue oscillation be-neath it.In Fig. 12 (b) we compare relative intensities I ( q z , t ) /I ( q z , t <
0) for different scattering vectors q z with the input average strain and magnetizationof within the Fe/Cr SL, c.f. panel (a). Depending onthe selected q z the observed transients resemble dom-inantly the coherent acoustic phonon or magnetiza-tion dynamics or a mixture of both. Note that evenon the AFM Bragg peak maximum at q z = 4 . − the relative drop of the intensity by about 75 % is q z [nm ] R e f l e c t i v i t y (a) -1 ps 0 ps 7 ps 15 ps4.4 4.5 4.6 4.7 4.8 4.9 q z [nm ] D e l a y [ p s ] (b) Figure 11: Transient resonant magnetic X-ray scatteringaround q SL1.5 z = 4 . − at 720 eV featuring a strongquenching and recovery of the AFM Bragg peak intensity aswell as a peak shift due to coherent acoustic phonon dynamics. not comparable with the change of the average mag-netization in the Fe layers of less than 60 %. Thisresults clearly indicates the importance of a carefulanalysis of time-resolved scattering data especially ifmagnetic effects are involved.
4. Conclusions & Outlook
With the porting of the udkm1Dsim toolbox from matlab (MathWorks Inc.) to Python several newfeatures have been added to the toolbox. The imple-mentation of magnetic properties as well as the res-onant magnetic scattering formalism drastically ex-tends its outreach. The toolbox allows to carry outa full set of static and dynamics simulations on oneand the same sample structure without switching be-tween packages or even programming languages. Atthe same time it relies to 100 % on free and open-source software making it accessible to a broader au-11
Delay [ps] M a g n e t i z a t i o n (a) S t r a i n [ % ] Delay [ps] r e l . R e f l e c t i v i t y (b) Figure 12: (a) Average magnetization of Fe layers and averagestrain of Fe and Cr layers within the SL structure. (b) Relativereflectivity at selected q z positions from Fig. 11. dience in research and teaching. This is further sup-ported by its ease of use and detailed documentation.The open-source aspect of the udkm1Dsim tool-box allows for easy adaption and adding extensionsto it. These can be either done by the users them-selves or discussed at the project page at github.com/dschick/udkm1Dsim . Possible new features canbe interfaces to other existing simulation packages,such as Ubermag [18] in order to allow for more de-tailed magnetization dynamics. Also the inclusionof temperatures in the X-ray scattering simulationswill be interesting in terms of Debye-Waller-effectsand transient changes of the scattering factors due toexcitation of the band structure. Additional probingtechniques, such as visible light or electron scatteringcould be included in the future as well.
5. Acknowledgment
We would like to acknowledge the discussionswith Marc Herzog, St´ephane Grenier, Lukas Alber,Valentino Scalera, Vivek Unikandanunni, and Ste- fano Bonetti. We further thank Lo¨ıc Le Guyader forproviding us with the source code for the optical mul-tilayer formalism as well as Lisa-Marie Kern, MartinBorchert, and Martin Hennecke for extensive testingof the toolbox.
References [1] L. Waldecker, R. Bertoni, R. Ernstorfer, J. Vor-berger, Electron-phonon coupling and en-ergy flow in a simple metal beyond the two-temperature approximation, Phys. Rev. X 6(2016) 1–11. doi: . arXiv:1507.03743 .[2] D. Schick, M. Herzog, H. Wen, P. Chen,C. Adamo, P. Gaal, D. G. Schlom, P. G.Evans, Y. Li, M. Bargheer, LocalizedExcited Charge Carriers Generate UltrafastInhomogeneous Strain in the MultiferroicBiFeO3, Phys. Rev. Lett. 112 (2014)097602. URL: http://link.aps.org/doi/10.1103/PhysRevLett.112.097602 . doi: .[3] M. Nicoul, U. Shymanovich, A. Tarasevitch,D. von der Linde, K. Sokolowski-Tinten, Pi-cosecond acoustic response of a laser-heatedgold-film studied with time-resolved x-raydiffraction, Appl. Phys. Lett. 98 (2011)191902. URL: http://link.aip.org/link/APPLAB/v98/i19/p191902/s1{&}Agg=doi .doi: .[4] F. Willems, C. von Korff Schmising, C. Str¨uber,D. Schick, D. Engel, J. Dewhurst, P. Elliot,S. Sharma, E. Eisebitt, Optical inter-site spintransfer probed by energy and spin-resolvedtransient absorption spectroscopy, Nat. Com-mun. accepted (2020).[5] W. You, P. Tengdin, C. Chen, X. Shi, D. Zusin,Y. Zhang, C. Gentry, A. Blonsky, M. Keller,P. M. Oppeneer, H. Kapteyn, Z. Tao, M. Mur-nane, Revealing the nature of the ultrafast mag-netic phase transition in ni by correlating ex-treme ultraviolet magneto-optic and photoemis-sion spectroscopies, Phys. Rev. Lett. 121 (2018)1277204. URL: https://link.aps.org/doi/10.1103/PhysRevLett.121.077204 . doi: .[6] C. Stamm, T. Kachel, N. Pontius, R. Mitzner,T. Quast, K. Holldack, S. Khan, C. Lupulescu,E. F. Aziz, M. Wietstruk, H. a. D¨urr, W. Eber-hardt, Femtosecond modification of elec-tron localization and transfer of angular mo-mentum in nickel., Nat. Mater. 6 (2007)740–3. URL: . doi: .[7] E. Jal, V. L´opez-Flores, N. Pontius, T. Fert´e,N. Bergeard, C. Boeglin, B. Vodungbo,J. L¨uning, N. Jaouen, Structural dynamicsduring laser-induced ultrafast demagnetization,Phys. Rev. B 95 (2017) 184422. URL: http://link.aps.org/doi/10.1103/PhysRevB.95.184422 . doi: . arXiv:1701.01375 .[8] T. Henighan, M. Trigo, S. Bonetti, P. Granitzka,D. Higley, Z. Chen, M. P. Jiang, R. Kukreja,A. Gray, A. H. Reid, E. Jal, M. C. Hoffmann,M. Kozina, S. Song, M. Chollet, D. Zhu, P. F.Xu, J. Jeong, K. Carva, P. Maldonado, P. M.Oppeneer, M. G. Samant, S. S. P. Parkin, D. A.Reis, H. A. D¨urr, Generation mechanism ofterahertz coherent acoustic phonons in Fe, Phys.Rev. B 93 (2016) 220301. URL: https://link.aps.org/doi/10.1103/PhysRevB.93.220301 .doi: .[9] A. von Reppert, J. Pudell, A. Koc, M. Rein-hardt, W. Leitenberger, K. Dumesnil, F. Zam-poni, M. Bargheer, Persistent nonequilibriumdynamics of the thermal energies in the spinand phonon systems of an antiferromagnet,Struct. Dyn. 3 (2016) 054302. URL: http://dx.doi.org/10.1063/1.4961253 . doi: .[10] S. I. Anisimov, B. L. Kapeliovich, T. L.Perel’man, Electron emission from metal sur-faces exposed to ultrashort laser pulses, J. Exp.Theor. Phys. 39 (1975) 375–377. [11] B. Koopmans, G. Malinowski, F. Dalla Longa,D. Steiauf, M. F¨ahnle, T. Roth, M. Cinchetti,M. Aeschlimann, Explaining the paradoxi-cal diversity of ultrafast laser-induced demag-netization., Nat. Mater. 9 (2010) 259–265.URL: http://dx.doi.org/10.1038/nmat2593 .doi: .[12] L. Alber, V. Scalera, V. Unikandanunni,D. Schick, S. Bonetti, NTMpy: An open sourcepackage for solving coupled parabolic differen-tial equations in the framework of the three-temperature model, 2020.[13] C. Thomsen, H. Grahn, H. Maris, J. Tauc,Surface generation and detection of phononsby picosecond light pulses, Phys. Rev. B34 (1986) 4129–4138. URL: http://link.aps.org/doi/10.1103/PhysRevB.34.4129 . doi: .[14] M. Herzog, D. Schick, P. Gaal, R. Shay-duk, C. Korff Schmising, M. Bargheer,Analysis of ultrafast X-ray diffraction datain a linear-chain model of the lattice dy-namics, Appl. Phys. A 106 (2012) 489–499. URL: .doi: .[15] SPILADY - A Spin-Lattice Dy-namics Simulation Program,https://ccfe.ukaea.uk/resources/spilady, 2021.[16] P.-W. Ma, S. Dudarev, C. Woo, Spi-lady: A parallel cpu and gpu code forspin–lattice magnetic molecular dynam-ics simulations, Computer Physics Com-munications 207 (2016) 350–361. URL: . doi: https://doi.org/10.1016/j.cpc.2016.05.017 .[17] U. Atxitia, D. Hinzke, U. Nowak, Fundamentalsand applications of the Landau-Lifshitz-Blochequation, J. Phys. D. Appl. Phys. 50 (2017).doi: .1318] Ubermag, https://ubermag.github.io, 2021.[19] mumax3 GPU-accelerated micromagnetism,https://mumax.github.io/, 2021.[20] The Object Oriented MicroMagnetic Frame-work (OOMMF) project at ITL/NIST,https://math.nist.gov/oommf/, 2021.[21] A. Vansteenkiste, J. Leliaert, M. Dvornik,M. Helsen, F. Garcia-Sanchez, B. Van Waeyen-berge, The design and verification of Mu-Max3, AIP Adv. 4 (2014). URL: http://dx.doi.org/10.1063/1.4899186 . doi: . arXiv:1406.7635 .[22] K. Ohta, H. Ishida, Matrix formalism for cal-culation of the light beam intensity in stratifiedmultilayered films, and its use in the analysisof emission spectra, Appl. Opt. 29 (1990)2466. URL: .doi: .[23] L. Le Guyader, A. Kleibert, F. Nolting,L. Joly, P. M. Derlet, R. V. Pisarev, A. Kir-ilyuk, T. Rasing, a. V. Kimel, Dynam-ics of laser-induced spin reorientation inCo/SmFeO3 heterostructure, Phys. Rev.B 87 (2013) 054437. URL: http://link.aps.org/doi/10.1103/PhysRevB.87.054437 .doi: .[24] D. Kriegner, E. Wintersberger, J. Stangl,Xrayutilities: A versatile tool for recip-rocal space conversion of scattering datarecorded with linear and area detectors,J. Appl. Crystallogr. 46 (2013) 1162–1170. doi: . arXiv:arXiv:1304.1732v1 .[25] S. Stepanov, E. Kondrashkina, R. K¨ohler,D. Novikov, G. Materlik, S. Durbin, Dy-namical x-ray diffraction of multilayers andsuperlattices: Recursion matrix extensionto grazing angles, Phys. Rev. B 57(1998) 4829–4841. URL: http://link.aps.org/doi/10.1103/PhysRevB.57.4829 . doi: . [26] D. L. Windt, IMD—Software for mod-eling the optical properties of multilayerfilms, Comput. Phys. 12 (1998) 360. URL: http://scitation.aip.org/content/aip/journal/cip/12/4/10.1063/1.168689 .doi: .[27] J. Als-Nielsen, D. McMorrow, Elements ofModern X-ray Physics, John Wiley & Sons,Inc., Hoboken, NJ, USA, 2011. URL: http://doi.wiley.com/10.1002/9781119998365 .doi: .[28] M. Elzo, E. Jal, O. Bunau, S. Grenier,Y. Joly, A. Y. Ramos, H. C. Tolentino,J. M. Tonnerre, N. Jaouen, X-ray resonantmagnetic reflectivity of stratified magneticstructures: Eigenwave formalism and ap-plication to a W/Fe/W trilayer, J. Magn.Magn. Mater. 324 (2012) 105–112. URL: http://dx.doi.org/10.1016/j.jmmm.2011.07.019 .doi: .[29] S. Macke, E. Goering, Magnetic reflectometryof heterostructures, J. Phys. Condens. Mat-ter 26 (2014) 363201. URL: . doi: .[30] D. Schick, A. Bojahr, M. Herzog, R. Shay-duk, C. von Korff Schmising, M. Bargheer,udkm1Dsim—A simulation toolkit for 1Dultrafast dynamics in condensed matter,Comput. Phys. Commun. 185 (2014) 651–660. URL: .doi: https://link.aps.org/doi/10.1103/PhysRevLett.57.2442 .doi: .[34] E. E. Fullerton, M. J. Conover, J. E. Mattson,C. H. Sowers, S. D. Bader, Oscillatory interlayercoupling and giant magnetoresistance in epitax-ial Fe/Cr(211) and (100) superlattices, Phys.Rev. B 48 (1993) 15755–15763. doi: .[35] V. Holy, U. Pietsch, T. Baumbach, High-resolution X-ray scattering from thin films andmultilayers, Springer Berlin / Heidelberg, 1999.[36] A. Nefedov, J. Grabis, A. Bergmann, F. Radu,H. Zabel, X-ray resonant magnetic scattering byFe/Cr superlattices, Superlattices Microstruct.37 (2005) 99–106. doi: .[37] C. T. Chantler, Detailed tabulation of atomicform factors, photoelectric absorption andscattering cross section, and mass attenua-tion coefficients in the vicinity of absorptionedges in the soft X-ray ( Z = 30–36, Z =60–89, E = 0.1–10 keV) – addressing conver-gence iss, J. Synchrotron Radiat. 8 (2001)1124–1124. URL: http://scripts.iucr.org/cgi-bin/paper?S0909049501008305 .doi: .[38] B. Henke, E. Gullikson, J. Davis, X-Ray In-teractions: Photoabsorption, Scattering, Trans-mission, and Reflection at E = 50-30,000 eV, Z= 1-92, At. Data Nucl. Data Tables 54 (1993)181–342. URL: http://linkinghub.elsevier.com/retrieve/pii/S0092640X83710132 .doi: .[39] Dyna Project, http://dyna.neel.cnrs.fr, 2021.[40] The Elk Code, http://elk.sourceforge.net, 2021.[41] KKcalc, https://github.com/benajamin/kkcalc,2021. [42] B. Watts, Calculation of the kramers-kronig transform of x-ray spectra by apiecewise laurent polynomial method,Opt. Express 22 (2014) 23628–23639.URL: .doi:10.1364/OE.22.023628