Starting from the spin-flip tutorial, we want to remove the analyzer and perform a reflectivity simulation with incident polarized neutrons and no polarization analysis of the reflected beam. All other parameters of the simulation remain unchanged.
Omitting the polarization analysis corresponds to summing up the spin-flip and non-spin-flip channels for both incident polarization states: $$I^+ = I^{++} + I^{+-} \hspace{2em} I^- = I^{- -} + I^{-+}$$
In a script, these two polarization measurements can be computed according to:
r_plus = results_pp + results_pm
r_minus = results_mm + results_mp
Here, results_pp
, results_mm
are the reflectivities in the non-spin-flip channels computed by calling
q, results_pp = run_simulation(R3(0, 1, 0),
R3(0, 1, 0))
q, results_mm = run_simulation(R3(0, -1, 0),
R3(0, -1, 0))
and the spin-flip channels are computed by
q, results_pm = run_simulation(R3(0, 1, 0),
R3(0, -1, 0))
q, results_mp = run_simulation(R3(0, -1, 0),
R3(0, 1, 0))
However, this approach has the disadvantage that it requires to perform four simulations in order to compute the two reflectivity curves.
Instead, BornAgain supports the direct computation of the two channels for incident polarized neutrons without polarization analysis.
This can simply be achieved by not specifying any analyzer when setting up the simulation
object and hence omitting the line
simulation.setAnalyzerProperties(analyzer, 1.0, 0.5)
In this example, this is achieved by calling the run_simulation
function for up and down polarization of the incident neutron beam as follows:
q, results_p = run_simulation(R3(0, 1, 0))
q, results_m = run_simulation(R3(0, -1, 0))
The attached script computes the two channels with both approaches and plots the results. It is then easy to check that they are identical. This is the resulting plot that shows the computed reflectivity for up and down polarization of the incident neutrons:
Here is the complete example:
|
|