Parameter Overview#
NuMagSANS simulations are configured using the Python function
NuMagSANS.write_config(...)
This function generates a configuration file that is passed to the NuMagSANS backend executable. The parameters listed below correspond directly to entries in the generated configuration file and control the physical model and numerical settings of the simulation.
Example Script#
The following script demonstrates a minimal NuMagSANS workflow.
from NuMagSANS import NuMagSANS
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent
# Create NuMagSANS object
sim = NuMagSANS()
# Temporary configuration file
config = BASE_DIR / "NuMagSANSInput_temp.conf"
# Write configuration file
sim.write_config(
config,
MagData_activate=1,
MagDataPath=str(BASE_DIR / "RealSpaceData" / "MagData"),
foldernameSANSData=str(BASE_DIR / "NuMagSANS_Output"),
Fourier_Approach="atomistic",
User_Selection=[1, 2, 3],
Scattering_Volume_V=2.618e-24,
enable_outputs=["SpinFlip_2D", "SpinFlip_1D"]
)
# Run NuMagSANS simulation
sim.run(config)
# Remove temporary configuration file
sim.config_clear(config)
Data Paths and Data Selection#
These parameters define where the simulation reads input data and where results are written.
NucDataPathDefault path
RealSpaceData/NucDataNucData_activateDefault value 0
MagDataPathDefault path
RealSpaceData/MagDataMagData_activateDefault value 0
StructDataFilenameDefault path
RealSpaceData/StructData.csvStructData_activateDefault value 0
foldernameSANSDataDefault
NuMagSANS_Output
Exclude_Zero_MomentsFourier Approach#
Defines how the Fourier transform from real space to reciprocal space is performed.
Fourier_ApproachDefault
atomisticOptions:atomistic,micromagnetic
Loop Control#
These parameters control batch simulations or repeated calculations.
Loop_ModusDescription: Enable looping over simulation indices Default
0Loop_FromDescription: First index used in loop simulations Default
1Loop_ToDescription: Last index used in loop simulations Default
20User_SelectionDescription: Explicit list of selected indices Default
[1]
Constant Parameters#
XYZ_Unit_FactorConversion factors for coordinate units. Scaling factor applied to spatial coordinates. This parameter is equal to
1, if the positional input data is in units of \(\mathrm{nm}\). Default value1Scattering_Volume_VEffective scattering volume in units of \(\mathrm{m}^3\) Default value
2.618e-24RotMat_alphaRotation angle in degree. Rotates the sample Default value
0.0RotMat_betaRotation angle in degree. Rotates the sample in the \(x-y\)-plane. Default value
0.0PolarizationPolarization vector (Px, Py, Pz). Defines the polarization vector of the incoming neutron beam. Default
(0,0,1)Number_Of_q_PointsNumber of sampled q values in Fourier space. Default value
1000Number_Of_theta_PointsNumber of angular sampling points in Fourier space. Default value
1000Number_Of_r_PointsNumber of sampled q values in real space (correlation). Default value
1000Number_Of_alpha_PointsNumber of angular sampling points in real space (correlation). Default value
1000q_maxMaximum scattering vector in Fourier space in units of \(\mathrm{nm}^{-1}\) Default value
3.0r_maxMaximum real-space correlation distance in units of \(\mathrm{nm}\). Default value ``15.0 ``
Micromagnetic Parameters#
Parameters describing the magnetic properties of discretized simulation cells.
Cell_Nuclear_SLDDescription: Nuclear scattering length density of the cell Default
8e14Cell_MagnetizationDescription: Magnetization inside the discretized cell Default
486e3Cuboid_Cell_SizeDescription: Dimensions of the discretization cell (x,y,z) Default
(2,2,2)
Output Options#
2D SANS cross sections#
In NuMagSANS, the incoming neutron beam is defined to propagate along the \(x\)-axis, such that the corresponding wave vector satisfies \(\mathbf{k}_0 \parallel \mathbf{e}_x\). The two-dimensional detector plane is oriented perpendicular to the incident beam direction. The scattering vector \(\mathbf{q}\) on the detector can therefore be written as
In NuMagSANS the 2D SANS cross sections are exported in units of \(\mathrm{cm}^{-1}\).
Nuclear_2DNuclear SANS cross section on the 2D detector.
\[\frac{d\Sigma_{\mathrm{N}}}{d\Omega}(q,\theta) = \frac{8\pi^3}{V}\, |\widetilde{N}|^2\]Unpolarized_2DUnpolarized magnetic SANS cross section on the 2D detector.
\[\frac{d\Sigma_{\mathrm{M}}}{d\Omega}(q,\theta) = \frac{8\pi^3}{V}\, b_{\mathrm{H}}^2 |\widetilde{\mathbf{Q}}|^2\]Polarized_2DAuxiliary polarized magnetic SANS cross section on the 2D detector.
\[\frac{d\Sigma_{\mathrm{P}}}{d\Omega}(q,\theta) = \frac{8\pi^3}{V}\, b_{\mathrm{H}}^2 \left|\hat{\mathbf{P}}\cdot\widetilde{\mathbf{Q}}\right|^2\]NuclearMagnetic_2DNuclear–magnetic SANS cross section on the 2D detector.
\[\frac{d\Sigma_{\mathrm{NM}}}{d\Omega}(q,\theta) = \frac{8\pi^3}{V}\, b_{\mathrm{H}} \hat{\mathbf{P}}\cdot\left[\widetilde{N}\widetilde{\mathbf{Q}}^{\ast}+\widetilde{N}^{\ast}\widetilde{\mathbf{Q}}\right]\]Chiral_2DChiral SANS cross section on the 2D detector.
\[\frac{d\Sigma_{\chi}}{d\Omega}(q,\theta) = -i\frac{8\pi^3}{V}\, b_{\mathrm{H}}^2 \hat{\mathbf{P}}\cdot \left(\widetilde{\mathbf{Q}}\times\widetilde{\mathbf{Q}}^{\ast}\right)\]SpinFlip_2DSpin-flip SANS cross section on the 2D detector.
\[\frac{d\Sigma_{\mathrm{sf}}}{d\Omega}(q,\theta) = \frac{d\Sigma_{\mathrm{M}}}{d\Omega}(q,\theta) - \frac{d\Sigma_{\mathrm{P}}}{d\Omega}(q,\theta)\]PM_SpinFlip_2DSpin-flip SANS cross section on the 2D detector.
\[\frac{d\Sigma^{+-}}{d\Omega}(q,\theta) = \frac{d\Sigma_{\mathrm{sf}}}{d\Omega}(q,\theta) + \frac{d\Sigma_{\chi}}{d\Omega}(q,\theta)\]MP_SpinFlip_2DSpin-flip SANS cross section on the 2D detector.
\[\frac{d\Sigma^{+-}}{d\Omega}(q,\theta) = \frac{d\Sigma_{\mathrm{sf}}}{d\Omega}(q,\theta) - \frac{d\Sigma_{\chi}}{d\Omega}(q,\theta)\]PP_NonSpinFlip_2DNon-spin-flip SANS cross section on the 2D detector.
\[\frac{d\Sigma^{++}}{d\Omega}(q,\theta) = \frac{d\Sigma_{\mathrm{N}}}{d\Omega}(q,\theta) + \frac{d\Sigma_{\mathrm{NM}}}{d\Omega}(q,\theta) + \frac{d\Sigma_{\mathrm{P}}}{d\Omega}(q,\theta)\]MM_NonSpinFlip_2DNon-spin-flip SANS cross section on the 2D detector.
\[\frac{d\Sigma^{--}}{d\Omega}(q,\theta) = \frac{d\Sigma_{\mathrm{N}}}{d\Omega}(q,\theta) - \frac{d\Sigma_{\mathrm{NM}}}{d\Omega}(q,\theta) + \frac{d\Sigma_{\mathrm{P}}}{d\Omega}(q,\theta)\]P_SANSPOL_2DNon-Spin-flip SANS cross section on the 2D detector.
\[\frac{d\Sigma^{+}}{d\Omega}(q,\theta) = \frac{d\Sigma^{++}}{d\Omega}(q,\theta) + \frac{d\Sigma^{+-}}{d\Omega}(q,\theta)\]M_SANSPOL_2DNon-Spin-flip SANS cross section on the 2D detector.
\[\frac{d\Sigma^{-}}{d\Omega}(q,\theta) = \frac{d\Sigma^{--}}{d\Omega}(q,\theta) + \frac{d\Sigma^{-+}}{d\Omega}(q,\theta)\]
2D correlation functions#
NuMagSANS can compute two-dimensional real-space correlation functions from the detector-plane SANS cross sections. The real-space vector in the detector plane is parameterized as
while the scattering vector in reciprocal space is written as
Using these parametrizations the scalar product becomes
The two-dimensional correlation functions are obtained from the SANS cross sections via the cosine transform
The following two-dimensional correlation functions can be calculated.
Nuclear_Corr_2D2D correlation function of the nuclear SANS cross section.
\[C_{\mathrm N}(r,\alpha) = \int_{0}^{\infty}\int_{0}^{2\pi} \frac{d\Sigma_{\mathrm N}}{d\Omega}(q,\theta) \cos\left(qr\cos(\theta-\alpha)\right) q\,dq\,d\theta\]Unpolarized_Corr_2D2D correlation function of the unpolarized magnetic SANS cross section.
\[C_{\mathrm M}(r,\alpha) = \int_{0}^{\infty}\int_{0}^{2\pi} \frac{d\Sigma_{\mathrm M}}{d\Omega}(q,\theta) \cos\left(qr\cos(\theta-\alpha)\right) q\,dq\,d\theta\]Polarized_Corr_2D2D correlation function of the polarized magnetic SANS cross section.
\[C_{\mathrm P}(r,\alpha) = \int_{0}^{\infty}\int_{0}^{2\pi} \frac{d\Sigma_{\mathrm P}}{d\Omega}(q,\theta) \cos\left(qr\cos(\theta-\alpha)\right) q\,dq\,d\theta\]NuclearMagnetic_Corr_2D2D correlation function of the nuclear–magnetic interference SANS cross section.
\[C_{\mathrm{NM}}(r,\alpha) = \int_{0}^{\infty}\int_{0}^{2\pi} \frac{d\Sigma_{\mathrm{NM}}}{d\Omega}(q,\theta) \cos\left(qr\cos(\theta-\alpha)\right) q\,dq\,d\theta\]SpinFlip_Corr_2D2D correlation function of the spin-flip SANS cross section.
\[C_{\mathrm{sf}}(r,\alpha) = \int_{0}^{\infty}\int_{0}^{2\pi} \frac{d\Sigma_{\mathrm{sf}}}{d\Omega}(q,\theta) \cos\left(qr\cos(\theta-\alpha)\right) q\,dq\,d\theta\]Chiral_Corr_2D2D correlation function of the chiral SANS cross section.
\[C_{\chi}(r,\alpha) = \int_{0}^{\infty}\int_{0}^{2\pi} \frac{d\Sigma_{\chi}}{d\Omega}(q,\theta) \cos\left(qr\cos(\theta-\alpha)\right) q\,dq\,d\theta\]PM_SpinFlip_Corr_2D2D correlation function of the \((+,-)\) spin-flip channel.
\[C^{+-}(r,\alpha) = \int_{0}^{\infty}\int_{0}^{2\pi} \frac{d\Sigma^{+-}}{d\Omega}(q,\theta) \cos\left(qr\cos(\theta-\alpha)\right) q\,dq\,d\theta\]MP_SpinFlip_Corr_2D2D correlation function of the \((-,+)\) spin-flip channel.
\[C^{-+}(r,\alpha) = \int_{0}^{\infty}\int_{0}^{2\pi} \frac{d\Sigma^{-+}}{d\Omega}(q,\theta) \cos\left(qr\cos(\theta-\alpha)\right) q\,dq\,d\theta\]PP_NonSpinFlip_Corr_2D2D correlation function of the \((+,+)\) non-spin-flip channel.
\[C^{++}(r,\alpha) = \int_{0}^{\infty}\int_{0}^{2\pi} \frac{d\Sigma^{++}}{d\Omega}(q,\theta) \cos\left(qr\cos(\theta-\alpha)\right) q\,dq\,d\theta\]MM_NonSpinFlip_Corr_2D2D correlation function of the \((-,-)\) non-spin-flip channel.
\[C^{--}(r,\alpha) = \int_{0}^{\infty}\int_{0}^{2\pi} \frac{d\Sigma^{--}}{d\Omega}(q,\theta) \cos\left(qr\cos(\theta-\alpha)\right) q\,dq\,d\theta\]P_SANSPOL_Corr_2D2D correlation function of the SANSPOL \((+ )\) channel.
\[C^{+}(r,\alpha) = \int_{0}^{\infty}\int_{0}^{2\pi} \frac{d\Sigma^{+}}{d\Omega}(q,\theta) \cos\left(qr\cos(\theta-\alpha)\right) q\,dq\,d\theta\]M_SANSPOL_Corr_2D2D correlation function of the SANSPOL \((- )\) channel.
\[C^{-}(r,\alpha) = \int_{0}^{\infty}\int_{0}^{2\pi} \frac{d\Sigma^{-}}{d\Omega}(q,\theta) \cos\left(qr\cos(\theta-\alpha)\right) q\,dq\,d\theta\]
1D Azimuthally averaged SANS cross sections#
In NuMagSANS the 1D SANS cross sections are exported in units of \(\mathrm{cm}^{-1}\).
Nuclear_1DAzimuthally averaged nuclear SANS cross section.
\[I_{\mathrm{N}}(q) = \frac{1}{2\pi} \int_{0}^{2\pi} \frac{d\Sigma_{\mathrm{N}}}{d\Omega}(q,\theta) \, d\theta\]Unpolarized_1DAzimuthally averaged unpolarized magnetic SANS cross section.
\[I_{\mathrm{M}}(q) = \frac{1}{2\pi} \int_{0}^{2\pi} \frac{d\Sigma_{\mathrm{M}}}{d\Omega}(q,\theta) \, d\theta\]Polarized_1DAzimuthally averaged polarized magnetic SANS cross section.
\[I_{\mathrm{P}}(q) = \frac{1}{2\pi} \int_{0}^{2\pi} \frac{d\Sigma_{\mathrm{P}}}{d\Omega}(q,\theta) \, d\theta\]NuclearMagnetic_1DAzimuthally averaged nuclear–magnetic interference cross section.
\[I_{\mathrm{NM}}(q) = \frac{1}{2\pi} \int_{0}^{2\pi} \frac{d\Sigma_{\mathrm{NM}}}{d\Omega}(q,\theta) \, d\theta\]Chiral_1DAzimuthally averaged chiral SANS cross section.
\[I_{\chi}(q) = \frac{1}{2\pi} \int_{0}^{2\pi} \frac{d\Sigma_{\chi}}{d\Omega}(q,\theta) \, d\theta\]SpinFlip_1DAzimuthally averaged spin-flip SANS cross section.
\[I_{\mathrm{sf}}(q) = \frac{1}{2\pi} \int_{0}^{2\pi} \frac{d\Sigma_{\mathrm{sf}}}{d\Omega}(q,\theta) \, d\theta\]PM_SpinFlip_1DAzimuthally averaged spin-flip SANS cross section for the \((+,-)\) polarization channel.
\[I^{+-}(q) = \frac{1}{2\pi} \int_{0}^{2\pi} \frac{d\Sigma^{+-}}{d\Omega}(q,\theta) \, d\theta\]MP_SpinFlip_1DAzimuthally averaged spin-flip SANS cross section for the \((-,+)\) polarization channel.
\[I^{-+}(q) = \frac{1}{2\pi} \int_{0}^{2\pi} \frac{d\Sigma^{-+}}{d\Omega}(q,\theta) \, d\theta\]PP_NonSpinFlip_1DAzimuthally averaged non-spin-flip SANS cross section for the \((+,+)\) polarization channel.
\[I^{++}(q) = \frac{1}{2\pi} \int_{0}^{2\pi} \frac{d\Sigma^{++}}{d\Omega}(q,\theta) \, d\theta\]MM_NonSpinFlip_1DAzimuthally averaged non-spin-flip SANS cross section for the \((-,-)\) polarization channel.
\[I^{--}(q) = \frac{1}{2\pi} \int_{0}^{2\pi} \frac{d\Sigma^{--}}{d\Omega}(q,\theta) \, d\theta\]P_SANSPOL_1DAzimuthally averaged SANSPOL cross section for positive neutron polarization.
\[I^{+}(q) = \frac{1}{2\pi} \int_{0}^{2\pi} \frac{d\Sigma^{+}}{d\Omega}(q,\theta) \, d\theta\]M_SANSPOL_1DAzimuthally averaged SANSPOL cross section for negative neutron polarization.
\[I^{-}(q) = \frac{1}{2\pi} \int_{0}^{2\pi} \frac{d\Sigma^{-}}{d\Omega}(q,\theta) \, d\theta\]
1D Correlation functions#
In addition to the azimuthally averaged SANS cross sections \(I(q)\), NuMagSANS can compute the corresponding real-space correlation functions \(c(r)\). These functions are obtained from the scattering intensity via a spherical Bessel transform
where \(j_0(x)\) denotes the spherical Bessel function of order zero,
In NuMagSANS the 1D correlation functions are exported in units of \(\mathrm{nm}^{-4}\). The following correlation functions can be calculated.
Nuclear_Corr_1DCorrelation function of the nuclear SANS cross section.
\[c_{\mathrm{N}}(r) = \int_{0}^{\infty} I_{\mathrm{N}}(q)\, j_0(qr)\, q^2 \, dq\]Unpolarized_Corr_1DCorrelation function of the unpolarized magnetic SANS cross section.
\[c_{\mathrm{M}}(r) = \int_{0}^{\infty} I_{\mathrm{M}}(q)\, j_0(qr)\, q^2 \, dq\]Polarized_Corr_1DCorrelation function of the polarized magnetic SANS cross section.
\[c_{\mathrm{P}}(r) = \int_{0}^{\infty} I_{\mathrm{P}}(q)\, j_0(qr)\, q^2 \, dq\]NuclearMagnetic_Corr_1DCorrelation function of the nuclear–magnetic interference SANS cross section.
\[c_{\mathrm{NM}}(r) = \int_{0}^{\infty} I_{\mathrm{NM}}(q)\, j_0(qr)\, q^2 \, dq\]Chiral_Corr_1DCorrelation function of the chiral SANS cross section.
\[c_{\chi}(r) = \int_{0}^{\infty} I_{\chi}(q)\, j_0(qr)\, q^2 \, dq\]SpinFlip_Corr_1DCorrelation function of the spin-flip SANS cross section.
\[c_{\mathrm{sf}}(r) = \int_{0}^{\infty} I_{\mathrm{sf}}(q)\, j_0(qr)\, q^2 \, dq\]PM_SpinFlip_Corr_1DCorrelation function of the \((+,-)\) spin-flip channel.
\[c^{+-}(r) = \int_{0}^{\infty} I^{+-}(q)\, j_0(qr)\, q^2 \, dq\]MP_SpinFlip_Corr_1DCorrelation function of the \((-,+)\) spin-flip channel.
\[c^{-+}(r) = \int_{0}^{\infty} I^{-+}(q)\, j_0(qr)\, q^2 \, dq\]PP_NonSpinFlip_Corr_1DCorrelation function of the \((+,+)\) non-spin-flip channel.
\[c^{++}(r) = \int_{0}^{\infty} I^{++}(q)\, j_0(qr)\, q^2 \, dq\]MM_NonSpinFlip_Corr_1DCorrelation function of the \((-,-)\) non-spin-flip channel.
\[c^{--}(r) = \int_{0}^{\infty} I^{--}(q)\, j_0(qr)\, q^2 \, dq\]P_SANSPOL_Corr_1DCorrelation function of the SANSPOL \((+ )\) channel.
\[c^{+}(r) = \int_{0}^{\infty} I^{+}(q)\, j_0(qr)\, q^2 \, dq\]M_SANSPOL_Corr_1DCorrelation function of the SANSPOL \((- )\) channel.
\[c^{-}(r) = \int_{0}^{\infty} I^{-}(q)\, j_0(qr)\, q^2 \, dq\]
1D Pair-distance distribution functions#
In addition to the correlation functions \(c(r)\), NuMagSANS can compute the corresponding pair-distance distribution functions \(p(r)\). These functions are obtained from the correlation functions via
Using the definition of \(c(r)\), the pair-distance distribution function can also be written as
In NuMagSANS the 1D pair-distance distribution functions are exported in units of \(\mathrm{nm}^{-2}\). The following pair-distance distribution functions can be calculated.
Nuclear_PairDist_1DPair-distance distribution function of the nuclear SANS cross section.
\[p_{\mathrm{N}}(r) = r^2 \int_{0}^{\infty} I_{\mathrm{N}}(q)\, j_0(qr)\, q^2 \, dq\]Unpolarized_PairDist_1DPair-distance distribution function of the unpolarized magnetic SANS cross section.
\[p_{\mathrm{M}}(r) = r^2 \int_{0}^{\infty} I_{\mathrm{M}}(q)\, j_0(qr)\, q^2 \, dq\]Polarized_PairDist_1DPair-distance distribution function of the polarized magnetic SANS cross section.
\[p_{\mathrm{P}}(r) = r^2 \int_{0}^{\infty} I_{\mathrm{P}}(q)\, j_0(qr)\, q^2 \, dq\]NuclearMagnetic_PairDist_1DPair-distance distribution function of the nuclear–magnetic interference SANS cross section.
\[p_{\mathrm{NM}}(r) = r^2 \int_{0}^{\infty} I_{\mathrm{NM}}(q)\, j_0(qr)\, q^2 \, dq\]Chiral_PairDist_1DPair-distance distribution function of the chiral SANS cross section.
\[p_{\chi}(r) = r^2 \int_{0}^{\infty} I_{\chi}(q)\, j_0(qr)\, q^2 \, dq\]SpinFlip_PairDist_1DPair-distance distribution function of the spin-flip SANS cross section.
\[p_{\mathrm{sf}}(r) = r^2 \int_{0}^{\infty} I_{\mathrm{sf}}(q)\, j_0(qr)\, q^2 \, dq\]PM_SpinFlip_PairDist_1DPair-distance distribution function of the \((+,-)\) spin-flip channel.
\[p^{+-}(r) = r^2 \int_{0}^{\infty} I^{+-}(q)\, j_0(qr)\, q^2 \, dq\]MP_SpinFlip_PairDist_1DPair-distance distribution function of the \((-,+)\) spin-flip channel.
\[p^{-+}(r) = r^2 \int_{0}^{\infty} I^{-+}(q)\, j_0(qr)\, q^2 \, dq\]PP_NonSpinFlip_PairDist_1DPair-distance distribution function of the \((+,+)\) non-spin-flip channel.
\[p^{++}(r) = r^2 \int_{0}^{\infty} I^{++}(q)\, j_0(qr)\, q^2 \, dq\]MM_NonSpinFlip_PairDist_1DPair-distance distribution function of the \((-,-)\) non-spin-flip channel.
\[p^{--}(r) = r^2 \int_{0}^{\infty} I^{--}(q)\, j_0(qr)\, q^2 \, dq\]P_SANSPOL_PairDist_1DPair-distance distribution function of the SANSPOL \((+ )\) channel.
\[p^{+}(r) = r^2 \int_{0}^{\infty} I^{+}(q)\, j_0(qr)\, q^2 \, dq\]M_SANSPOL_PairDist_1DPair-distance distribution function of the SANSPOL \((- )\) channel.
\[p^{-}(r) = r^2 \int_{0}^{\infty} I^{-}(q)\, j_0(qr)\, q^2 \, dq\]
Angular Spectrum#
Settings for angular spectrum calculations.
k_maxMaximum angular wave number. Default value
10Angular_SpecEnable angular spectrum calculation. (binary selection) Default value
0