Verified Commit 20425ece authored by Tobias WEBER's avatar Tobias WEBER
Browse files

cleanups

parent 483c94ee
......@@ -136,7 +136,7 @@ Dock window (a) of the main GUI (Fig. \ref{fig:gui}) sets up the metric tensor \
corresponding to the crystal $UB$ matrix using the sample definition.
A magnified view of this window is provided in Fig. \ref{fig:gui_xtal}.
As seen before, the $UB$ matrix transforms the crystal coordinate system into the instrument's
laboratory coordinate system.
laboratory coordinate system \cite{Lumsden2005}.
The necessary information for the $B$ matrix comprise the axis lengths of the sample lattice's
unit cell as well as the axis angles for the non-Cartesian crystal coordinate system.
The $UB$ matrix rotates the crystal coordinate system so that the $x$ and $y$ axes correspond
......@@ -174,7 +174,7 @@ Finally, the check boxes named ``scattering senses'' control the sign of the sca
If the box is checked, a positive angle corresponds to a counterclockwise sense, i.e. corresponding
to the usual mathematical definition, and alternatively to a clockwise sense when unchecked.
From the standpoint of the physics to be studied in the sample, these signs have no influence
in practice. They do, however, strongly affect the resolution of the instrument \cite{Eckold2014}
in practice. They do, however, strongly affect the resolution of the instrument \cite{Eckold2014} \cite[p. 260]{Shirane2002}
and have to be considered carefully in the set-up of an experiment.
\end{minipage}
......
......@@ -25,10 +25,11 @@ repulsion, for example by the electron hull \cite[p. 1]{Squires2012}.
In 1939, Otto Hahn used a Chadwick-type neutron source to irradiate uranium isotopes in an attempt to produce
heavy trans-uranium elements \cite{wiki_fission}. The measurements did not yield the expected results, because
instead of heavier elements, the experiment produced lighter elements. This was interpreted by Lise Meitner as
a splitting of the uranium nucleus, marking the discovery of nuclear fission \cite{wiki_fission}. A typical possible
channel of a fission reaction is the decay of uranium-235 into baryum-144 and krypton-89, where two to three
neutrons are produced by each reaction in addition to the daughter nuclei and energy \cite{wiki_fission}.
instead of heavier elements, the experiment produced lighter elements \cite{wiki_fission}.
This was interpreted by Lise Meitner as a splitting of the uranium nucleus, marking the discovery of
nuclear fission \cite{wiki_fission}.
A typical possible channel of a fission reaction is the decay of uranium-235 into baryum-144 and krypton-89,
where two to three neutrons are produced by each reaction in addition to the daughter nuclei and energy \cite{wiki_fission}.
In 1942, Enrico Fermi made use of the excess neutrons that are obtained by each fission reaction to produce a
continuous, self-sustaining chain reaction in the first artificial nuclear reactor, the
......@@ -56,8 +57,9 @@ Studying the structure and dynamics of crystals is made possible since neutrons
slowed down (moderated) into energy regions where their de Broglie wavelength $\lambda = h/p$ \cite[p. 89]{Gross2012}
corresponds to typical inter-atomic distances in crystal unit cells, which is of the order of 1 \AA{}ngstr\"om,
i.e. $10^{-10}$ m \cite[pp.1,3]{Squires2012}. In the formula, $p$ denotes the neutron momentum and $h$ Planck's constant.
Such a slowing-down of neutrons is usually performed using a secondary moderator outside the reactor's main moderator --
which itself sustains the nuclear fission -- for example using liquid $\mathrm{D_2O}$ \cite[p. 82]{Jacrot2021}.
Such a slowing-down of neutrons is usually performed using a secondary moderator \cite[p. 10]{ExperimentalFacilites}
outside the reactor's main moderator -- which itself sustains the nuclear fission --
for example using liquid $\mathrm{D_2O}$ \cite[p. 82]{Jacrot2021}.
Here, neutrons are brought into a new thermal equilibrium by elastic collisions with the nuclei of the moderator's
atoms \cite[p. 30]{Stacey2007}, i.e. the neutrons take the temperature and thus energy of the surrounding material.
......@@ -67,13 +69,13 @@ atoms \cite[p. 30]{Stacey2007}, i.e. the neutrons take the temperature and thus
While a modern research reactor houses a multitude of different instrument types, among them time-of-flight,
back-scattering and spin-echo spectrometers, furthermore Larmor, Laue and small-angle diffractometers (see, for example,
Refs. \cite{ExperimentalFacilites} and \cite[pp. 15-18]{Shirane2002} for an explanation of these types of instrument), in
Refs. \cite{ExperimentalFacilites} and \cite[pp. 15-18]{Shirane2002} for an explanation of these instruments), in
this section, we instead want to shortly present the most basic types of instrument, the two-axis diffractometer
and the triple-axis spectrometer. Together, the discovery of these two instruments by Clifford Shull and Bertram Brockhouse,
respectively, was awarded the 1994 Nobel Prize in Physics~\cite{web_nobel1994}.
A comprehensive introduction into these instruments, especially triple-axis spectroscopy, can be found in the
book by G. Shirane \cite{Shirane2002}. An advanced treatment of neutron scattering theory is given by
G. L. Squires \cite{Squires2012}.
book by G. Shirane \cite{Shirane2002}, which we follow here.
An advanced treatment of neutron scattering theory is given by G. L. Squires \cite{Squires2012}.
\subsection{Two-axis diffractometers}
......@@ -107,7 +109,7 @@ interpretation of Eq. \ref{eq:bragg} is depicted in Fig. \ref{fig:braggscatterin
The resulting monochromatic beam with the wavelength $\lambda_i$ and wavevector $\underline{k}_i$ is Bragg-scattered
a second time, this time from a sample powder containing small crystallites. Diffractometers typically contain hundreds
of neutron detectors surrounding the sample and picking up diffracted neutrons at a whole range of scattering angles
of neutron detectors surrounding the sample used for picking up diffracted neutrons at a whole range of scattering angles
$2 \theta_S$. The scattering angles define the momentum transfer from the neutron to the sample as \cite[p. 11]{Shirane2002}
\begin{equation}
\label{eq:Q}
......@@ -139,9 +141,10 @@ Together, they determine the structural build-up of the crystal.
\subsection{Triple-axis spectrometers}
In a two-axis diffractometer the scattering angle from a sample defines a momentum $\hbar \underline{Q}$ which is
transferred from the the neutron to the sample. It does not allow to select a sample-neutron energy transfer,
which is given by the de Broglie equation as \cite[p. 89]{Gross2012} \cite[p. 11]{Shirane2002}
In a two-axis diffractometer, the scattering angle from a sample defines a momentum $\hbar \underline{Q}$ which is
transferred from the the neutron to the sample \cite[p. 11]{Shirane2002}.
It does not allow to select a sample-neutron energy transfer, which is given by the de Broglie equation
as \cite[p. 89]{Gross2012} \cite[p. 11]{Shirane2002}
\begin{equation}
\label{eq:E}
E \ =\ E_i - E_f \ =\ \frac{\left( \hbar k_i \right)^2}{2 m_n} - \frac{\left( \hbar k_f \right)^2}{2 m_n}.
......@@ -169,7 +172,8 @@ Since we also know the incoming wavelength $\lambda_i$ before the scattering eve
transferred energy as given by Eq. \ref{eq:E}. This additional crystal and the corresponding instrument axis are named ``analyser''.
Fig. \ref{fig:spectroscopy} visualises the principles of the instrument, Fig. \ref{fig:thales} shows a typical triple-axis
instrument with its three axes, namely the monochromator in the right-hand side of the picture, the sample and the analyser
with the attached detector. A detailed description of all components comprising a TAS can be found in Ref. \cite[pp. 55-93]{Shirane2002}.
with the attached detector. A detailed description of all components comprising a TAS and their functions can be found
in Ref. \cite[pp. 55-93]{Shirane2002}.
\begin{figure}[htb]
\centering
......
......@@ -16,9 +16,9 @@ Problems that may arise can be rapidly analysed using the simplified environment
Before having been integrated into the main library or the GUI program, each essential function was tested
separately. This was done either via small test programs or via dedicated unit tests, which are discussed in
section \ref{sec:unit_tests}.
Integration tests of algorithms, where collections of functions are tested how and if they work together,
were performed using larger bespoke test tools, which implemented a simplified versions of the functionality
of the main programs. These are described in section \ref{sec:tests_tools}.
Integration tests \cite{wiki_integrationtest} of algorithms, where collections of functions are tested how
and if they work together, were performed using larger bespoke test tools, which implemented a simplified
versions of the functionality of the main programs. These are described in section \ref{sec:tests_tools}.
......@@ -162,7 +162,7 @@ convex hull of the transformed problem.
\section{Unit tests}
\label{sec:unit_tests}
A unit test tests if a given set of inputs to a function gives an expected set of outputs.
A unit test \cite{wiki_unittest} tests if a given set of inputs to a function gives an expected set of outputs.
Testing an algorithm containing several function calls also allows to check if a set of invariants
is fulfilled during the algorithm run, meaning between function calls.
Possible checks can either be fixed input values which are tested against known output values,
......
......@@ -1141,6 +1141,28 @@
}
@misc
{
wiki_unittest,
author = "{Wikipedia contributors}",
title = {{Unit testing --- {Wikipedia}{,} The Free Encyclopedia}},
year = "2021",
url = "https://en.wikipedia.org/w/index.php?title=Unit_testing&oldid=1028372048",
note = "[Online; accessed 4-October-2021]"
}
@misc
{
wiki_integrationtest,
author = "{Wikipedia contributors}",
title = {{Integration testing --- {Wikipedia}{,} The Free Encyclopedia}},
year = "2021",
url = "https://en.wikipedia.org/w/index.php?title=Integration_testing&oldid=1041463234",
note = "[Online; accessed 4-October-2021]"
}
@misc
{
cppwiki_concepts,
......@@ -1577,7 +1599,7 @@
{
web_NOMAD,
title = {{NOMAD Instrument Control System (Software)}},
author = {{ILL Instrument Control Group}},
author = {{J. Locatelli, Instrument Control Group at the Institut Laue-Langevin}},
year = {2021},
url = "https://code.ill.fr/instrument-control",
OPThowpublished = "\url{https://code.ill.fr/instrument-control}",
......@@ -1589,7 +1611,7 @@
{
web_NOMAD3d,
title = {{NOMAD 3D (Software)}},
author = {{ILL Instrument Control Group}},
author = {{Y. Le Goc, Instrument Control Group at the Institut Laue-Langevin}},
year = {2021},
url = "https://code.ill.fr/instrument-control/protos/nomad-3d",
note = "[Online; accessed 25-September-2021]",
......
......@@ -66,7 +66,7 @@ their scalar products, where we follow the derivation in Ref. \cite{wiki_fractio
%\subsection*{Basis vectors}
The next goal is to explicitly write the components of the vectors $\left| a \right>$, $\left| b \right>$, and $\left| c \right>$
in terms of their (scalar) lengths $a = \sqrt{\left< a | a \right>}$, $b = \sqrt{\left< b | b \right>}$, $c = \sqrt{\left< c | c \right>}$,
in terms of their lengths $a = \sqrt{\left< a | a \right>}$, $b = \sqrt{\left< b | b \right>}$, $c = \sqrt{\left< c | c \right>}$,
and the three angles.
To that end, we first choose -- without loss of generality -- $\left| a \right>$ along the $x$ axis, $\left| b \right>$ in the
$xy$ plane, and $\left| c \right>$ in general:
......@@ -77,32 +77,35 @@ $xy$ plane, and $\left| c \right>$ in general:
\end{equation}
Inserting $\left| a \right>$ and $\left| b \right>$ into Eq. \ref{eq:ab} gives:
Inserting $\left| a \right>$ and $\left| b \right>$ into Eq. \ref{eq:ab} gives the first component
of the $\left| b \right>$ vector:
\begin{equation} \left< a | b \right > \ =\ a_1 b_1 \ =\ ab \cos \gamma
\hspace{0.5cm} \Rightarrow \hspace{0.5cm} b_1 \ =\ b \cos \gamma. \end{equation}
Using the cross product between $\left| a \right>$ and $\left| b \right>$, we get:
Using the cross product between $\left| a \right>$ and $\left| b \right>$, we get the second component of $\left| b \right>$:
\begin{equation}
\left\Vert \left| a \right> \times \left| b \right> \right\Vert \ =\
\left\Vert \left( \begin{array}{c} 0 \\ 0 \\ a_1 b_2 \end{array} \right) \right\Vert \ =\
ab \sin \gamma \label{eq:crossab}
\hspace{0.5cm} \Rightarrow \hspace{0.5cm} b_2 \ =\ b \sin \gamma.
\end{equation}
The vector $\left| b \right>$ is now complete:
\begin{equation}
\boxed{ \left| b \right> \ =\ \left( \begin{array}{c} b \cos \gamma \\ b \sin \gamma \\ 0 \end{array} \right). }
\label{eq:bvec}
\end{equation}
Inserting $\left| a \right>$ and $\left| c \right>$ into Eq. \ref{eq:ac} gives:
Inserting $\left| a \right>$ and $\left| c \right>$ into Eq. \ref{eq:ac} gives the first component of $\left| c \right>$:
\begin{equation} \left< a | c \right > \ =\ a_1 c_1 \ =\ ac \cos \beta
\hspace{0.5cm} \Rightarrow \hspace{0.5cm} c_1 \ =\ c \cos \beta.
\end{equation}
Inserting $\left| b \right>$ and $\left| c \right>$ into Eq. \ref{eq:bc} gives:
Inserting $\left| b \right>$ and $\left| c \right>$ into Eq. \ref{eq:bc} yields the second component of $\left| c \right>$:
\begin{equation} \left< b | c \right > \ =\ b_1 c_1 + b_2 c_2 \ =\ bc \cos \alpha, \end{equation}
\begin{equation} b \cos \gamma \cdot c \cos \beta + b \sin \gamma \cdot c_2 \ =\ bc \cos \alpha
\hspace{0.5cm} \Rightarrow \hspace{0.5cm}
......@@ -114,8 +117,10 @@ The last component, $c_3$, can be obtained from the vector length normalisation,
\begin{equation} \left< c | c \right > \ =\ c_1^2 + c_2^2 + c_3^2 \ =\ c^2, \end{equation}
\begin{equation} c_3^2 \ =\ c^2 - c_1^2 - c_2^2
\hspace{0.5cm} \Rightarrow \hspace{0.5cm}
c_3^2 \ =\ c^2 \left[1 - \cos^2 \beta - \left(\frac{\cos \alpha - \cos \gamma \cos \beta}{\sin \gamma} \right)^2 \right],
c_3^2 \ =\ c^2 \left[1 - \cos^2 \beta - \left(\frac{\cos \alpha - \cos \gamma \cos \beta}{\sin \gamma} \right)^2 \right].
\end{equation}
The full vector $\left| c \right>$ is now reads:
\begin{equation} \boxed{ \left| c \right> \ =\ \left( \begin{array}{c}
c \cdot \cos \beta \\
c \cdot \frac{\cos \alpha - \cos \gamma \cos \beta}{\sin \gamma} \\
......@@ -124,7 +129,7 @@ The last component, $c_3$, can be obtained from the vector length normalisation,
The crystallographic $A$ matrix, which transforms real-space fractional to lab coordinates (\AA),
The crystallographic $A$ matrix, which transforms real-space fractional to lab coordinates (\AA) \cite{Lumsden2005},
is formed with the basis vectors in its columns \cite[p. 631]{Arens2015}:
\begin{equation}
A \ =\ \left(
......@@ -158,7 +163,7 @@ lattice \cite[pp. 11-15]{Shirane2002}.
Reciprocal space is constructed in a way to facilitate calculations with momenta on a periodic lattice,
for that reason it is also sometimes called momentum or Fourier space.
A comparison of the same Bragg scattering in real vs. reciprocal space is shown in Fig. \ref{fig:braggscattering_recip}.
It is obvious that the reciprocal view greatly simplifies the image: Bragg scattering on what is set of parallel
It is obvious that the reciprocal view greatly simplifies the image: Bragg scattering on what is a set of parallel
crystal planes in real space in panel (a) becomes a single point in reciprocal space \cite[p. 66]{Gross2012},
the so-called Bragg peak $\left| G \right>$ in panel (c). The reciprocal vector $\left| G \right>$ is
perpendicular to the original crystal planes and its length is related to their distance $d$ by
......@@ -184,7 +189,7 @@ discussed in the next section.
From the construction of reciprocal space, it can be shown that the basis vectors of reciprocal space
are mutually perpendicular to the corresponding real space basis vectors \cite[p. 60]{Gross2012}.
This directly leads to the so-called $B$ matrix, which transforms reciprocal-space relative lattice units (rlu)
to lab coordinates (1/\AA), is \cite[p. 60]{Gross2012}:
to lab coordinates (1/\AA) \cite{Lumsden2005}, is \cite[p. 60]{Gross2012}:
\begin{equation} B \ =\ 2 \pi A^{-t}, \end{equation}
where $-t$ denotes the transposed inverse.
We can now also determine the metric tensor \cite[pp. 807-809]{Arens2015} corresponding to the coordinate
......@@ -220,20 +225,20 @@ a summation over it is implied, see Ref. \cite{wiki_summation}.
\subsection{$U$ matrix}
The $B$ matrix alone yields the transformation from the non-orthogonal and reciprocal crystal
coordinate system into the orthogonal lab units.
coordinate system into the orthogonal lab units \cite{Lumsden2005}.
However, it does not yet take into account the actual rotation of the crystal so that a specific plane,
the so-called scattering plane, can be accessed by the two-dimensional movements of the instrument.
Such a rotation is performed by the $U$ matrix, whose rows contain two vectors inside the desired
scattering plane and the plane normal.
scattering plane and the plane normal \cite{Lumsden2005}.
These basis vectors are usually chosen along two orientation Bragg reflections \cite[pp. 87-88]{Shirane2002}
and are expressed in the orthogonal lab system, i.e. they are pre-multiplied by $B$.
For $U$ to be a rotation matrix, these basis vectors are normalised using, for instance, the
For $U$ to be a rotation matrix, the basis vectors are normalised using, for instance, the
Gram-Schmidt algorithm \cite[p. 744]{Arens2015} \cite[pp. 269-270]{Arfken2013} or
QR decomposition \cite[pp. 269-272]{Scarpino2011}.
In summary, a coordinate point $\left|Q_{\mathrm{rlu}}\right>$, which is given in relative lattice
units of the reciprocal crystal,
is transformed by the $B$ matrix into the orthogonal lab units used at the instrument.
is transformed by the $B$ matrix into the orthogonal lab units used at the instrument \cite{Lumsden2005}.
It is then rotated by the $U$ matrix to account for the actual crystal orientation \cite{Lumsden2005}:
\begin{equation}
\left|Q_{\mathrm{lab}}\right> \ =\ U \cdot B \cdot \left|Q_{\mathrm{rlu}}\right>.
......@@ -255,7 +260,8 @@ The derivation of basic scattering geometries in triple-axis spectrometers can b
which we follow here.
For the monochromator and analyser, the crystal angles $\theta_M$ and $\theta_A$ are coupled to
their scattering angles, they are simply half their value.
their scattering angles, they are simply half their value, because the Bragg condition of Eq. \ref{eq:bragg}
always has to be fulfilled.
The crystal rotation for the sample is not necessarily half its scattering angle, $\Theta_S \ne 2\theta_S/2$,
though, because the instrument can be freely positioned at any point of reciprocal crystal space.
......@@ -286,7 +292,7 @@ whose directions (but not lengths!) correspond directly to the neutron paths bef
respectively, as shown on the left-hand side of Fig. \ref{fig:scattering_triangle}. We can rearrange them so
that their tips meet, as depicted on the right-hand side of Fig. \ref{fig:scattering_triangle}, where the
scattering triangle is formed by $\left| k_i \right>$ and $\left| k_f \right>$ together with the
scattering vector $\left| Q \right> = \left| k_i \right> - \left| k_f \right>$.
scattering vector $\left| Q \right> = \left| k_i \right> - \left| k_f \right>$ \cite[p. 14]{Shirane2002}.
Here, the two wavevectors enclose the scattering angle $2 \theta_S$.
\begin{figure}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment