McStas logo McStas - A neutron ray-trace simulation package ILL; PSI; ESS Niels Bohr Institute DTU Physics

McStas

About McStas
 Conditions of use
 Authors/Contacts
 Project funding

Download
 Components
 Other Downloads (share)

Mailing list

Search web/mailinglist

Documentation
 Wiki (GitHub)
 McStas manual
 Publications

Links

Report bugs (GitHub)

Code-repository (GitHub)


Test and example instruments

5.5  Test and example instruments

Every instrument below is found in the Tests_polarization category of the example library (browsable via mcgui’s “New from Template” menu, or mcdoc).

5.5.1  Component-level regression tests

These verify a polarising component reduces correctly to its non-polarising counterpart, or exercise one component’s specific physics in isolation: Test_Pol_Bender, Test_Pol_FieldBox, Test_Pol_Guide_mirror, Test_Pol_Guide_Vmirror, Test_Pol_Mirror, Test_Pol_MSF, Test_Pol_SF_ideal, Test_Pol_Set, Test_Pol_Tabled, Test_pol_ideal, Test_Magnetic_Constant, Test_Magnetic_Majorana, and Test_Magnetic_Rotation (illustrating, respectively, the constant, majorana, and rotating field functions of section 5.3.3).

5.5.2  Test_Pol_TripleAxis

A complete example of a polarised triple-axis spectrometer: polarising monochromator and analyser, a vanadium (depolarising incoherent) sample, and a spin flipper – illustrating how the individual components of section 5.4 combine into a real instrument.

5.5.3  He3_spin_filter

Illustrates the use of a \(^3\)He spin filter cell for beam or analysis-side polarisation.

5.5.4  A spin-echo example: SE_example

SE_example (and its variant SE_example2, both written for the 2010 PNCMI school in Delft) is a mock-up transmission spin-echo instrument, and a compact illustration of most of the machinery described in this chapter working together:

  • Pol_mirror polarises the incoming beam and, symmetrically, analyses the scattered beam.

  • Pol_Bfield regions define the two (oppositely-signed) precession guide fields on either side of the sample position, exactly the nested/concentric field-stack usage of section 5.3.1 (other components – the sample, monitors – sit inside each field region, between its Pol_Bfield/Pol_Bfield_stop pair).

  • MeanPolLambda_monitor records the mean polarisation projection as a function of wavelength – the classic spin-echo readout, whose oscillation as a small guide-field perturbation dBz is scanned traces out the echo signal.

A typical scan takes the form

1mcrun SE_example.instr dBz=-0.0001,0.0001 -N41 -n1e5

sweeping a small field imbalance dBz between the two precession regions and recording the resulting polarisation echo via MeanPolLambda_monitor. The instrument’s own parameters (POL_ANGLE, Bguide, Bflip, dBz, Lam, dLam) let the polariser/analyser angle, the guide- and flipper-field strengths, and the source wavelength band be adjusted independently, and an optional incoherent scatterer (SAMPLE=1) can be inserted to study the effect of depolarising sample scattering on the echo.


Last Modified: Tuesday, 06-Oct-2026 21:19:11 CEST
Search website mailinglist archive GitHub repos