Noncollinear magnetic roughness

This example computes the diffuse scattering of polarized neutrons from two magnetic films on a substrate. The films are 12 and 17 nm thick and have the same nuclear SLD. Their magnetizations differ in size and direction, are not parallel to each other, and have components normal to the surface. The interface between the films therefore scatters only through the rotation of the magnetization. In Magnetic roughness only, by contrast, a single magnetic film lies on a nonmagnetic substrate.

All three interfaces are rough, with Gaussian heights of RMS 1.5 nm. They share one exponential height covariance with a lateral correlation length of 25 nm and no cutoff frequency. The heights of different interfaces are correlated, with a crosscorrelation depth of 40 nm.

The four curves are the four combinations of incident and detected neutron spin along +y and −y. They are computed with FullDWBA and 16 terms; see Diffuse approximations.

With 32 terms, the result is the same: the relative difference is below $10^{-6}$ in every spin channel. So 16 terms are enough here.

The calculation includes the stray magnetic field that each rough magnetic interface produces in all layers. The intensity is integrated over the azimuthal angle from −0.2° to 0.2°, and the specular peak is left out.

Result

Four polarized channels of diffuse roughness from noncollinear magnetic films

Sample

Two magnetic films with rough interfaces

Python script

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.10"
# dependencies = ["bornagain>=25,<26"]
# ///
"""
Polarized diffuse scattering from two noncollinear magnetic films.

The films have the same nuclear SLD, so the interface between them scatters
only through the rotation of the magnetization. The four spin channels are
computed with FullDWBA and 16 correlation terms.
"""
import bornagain as ba
ba.require_versions("bornagain>=25,<26")
from bornagain import R3, deg, nm


def get_sample():
    a_color = (0.48, 0.32, 0.80)
    b_color = (0.93, 0.48, 0.14)
    substrate_color = (0.28, 0.57, 0.82)
    a = ba.SLDMaterial('Film A', a_color, 8e-6, 0, R3(3e5, -4e5, 2e5))
    b = ba.SLDMaterial('Film B', b_color, 8e-6, 0, R3(-2e5, 6e5, -3e5))
    substrate = ba.SLDMaterial('Substrate', substrate_color, 2e-6, 0)
    model = ba.PoweredExponentialModel(1.5*nm, 0.5, 25*nm, float('inf'))
    roughness = ba.Roughness(model, ba.ErfTransient(),
                             ba.CommonDepthCrosscorrelation(40*nm))
    sample = ba.Sample()
    sample.addLayer(ba.Layer(ba.Vacuum()))
    sample.addLayer(ba.Layer(a, 12*nm, roughness))
    sample.addLayer(ba.Layer(b, 17*nm, roughness))
    sample.addLayer(ba.Layer(substrate, roughness))
    return sample


def get_simulation(sample, incident, detected):
    scan = ba.AlphaScan([0.6*deg])
    scan.setWavelength(0.4*nm)
    scan.setPolarization(incident)
    detector = ba.OffspecDetector(160,
                                  0.02*deg, 2*deg, -0.2*deg, 0.2*deg)
    detector.setAnalyzer(detected)
    simulation = ba.OffspecSimulation(scan, sample, detector)
    simulation.options().setIncludeSpecular(False)
    simulation.options().setRoughnessApproximation('FullDWBA', 16)
    return simulation


def calculate(sample, incident, detected, title):
    result = get_simulation(sample, incident, detected).simulate().flat()
    result.setTitle(title)
    return result


if __name__ == '__main__':
    sample = get_sample()
    ba.showSample3D(sample, sample_size=120*nm, seed=0)
    up = R3(0, 1, 0)
    results = [
        calculate(sample, up, up, '$++$'),
        calculate(sample, up, -up, '$+-$'),
        calculate(sample, -up, up, '$-+$'),
        calculate(sample, -up, -up, '$--$'),
    ]
    ba.plot_multicurve(results, legendloc='lower right')
    ba.plt.show()
auto/Examples/offspec/NoncollinearMagneticRoughness.py