BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
PolMatrices.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Base/Element/PolMatrices.h
6 //! @brief Defines class PolarizerPair.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_BASE_ELEMENT_POLMATRICES_H
21 #define BORNAGAIN_BASE_ELEMENT_POLMATRICES_H
22 
23 #include "Base/Spin/SpinMatrix.h"
24 #include "Base/Spin/Spinor.h"
25 
26 //! Convenience class for handling polarization density matrix and polarization analyzer operator
27 //! @ingroup simulation
28 
29 class PolMatrices {
30 public:
31  PolMatrices();
32  PolMatrices(SpinMatrix polarization, SpinMatrix analyzer);
33 
34  //! Sets the polarization density matrix (in spin basis along z-axis)
35  void setPolarizerMatrix(const SpinMatrix& polarization) { m_polarizer_matrix = polarization; }
36 
37  //! Gets the polarization density matrix (in spin basis along z-axis)
38  const SpinMatrix& polarizerMatrix() const { return m_polarizer_matrix; }
39 
40  //! Sets the polarization analyzer operator (in spin basis along z-axis)
41  void setAnalyzerMatrix(const SpinMatrix& analyzer) { m_analyzer_matrix = analyzer; }
42 
43  //! Gets the polarization analyzer operator (in spin basis along z-axis)
44  const SpinMatrix& analyzerMatrix() const { return m_analyzer_matrix; }
45 
46 private:
47  SpinMatrix m_polarizer_matrix; //!< polarization density matrix
48  SpinMatrix m_analyzer_matrix; //!< polarization analyzer operator
49 };
50 
51 #endif // BORNAGAIN_BASE_ELEMENT_POLMATRICES_H
52 #endif // USER_API
Defines class SpinMatrix.
Defines class Spinor.
Convenience class for handling polarization density matrix and polarization analyzer operator.
Definition: PolMatrices.h:29
void setAnalyzerMatrix(const SpinMatrix &analyzer)
Sets the polarization analyzer operator (in spin basis along z-axis)
Definition: PolMatrices.h:41
const SpinMatrix & polarizerMatrix() const
Gets the polarization density matrix (in spin basis along z-axis)
Definition: PolMatrices.h:38
SpinMatrix m_analyzer_matrix
polarization analyzer operator
Definition: PolMatrices.h:48
const SpinMatrix & analyzerMatrix() const
Gets the polarization analyzer operator (in spin basis along z-axis)
Definition: PolMatrices.h:44
SpinMatrix m_polarizer_matrix
polarization density matrix
Definition: PolMatrices.h:47
void setPolarizerMatrix(const SpinMatrix &polarization)
Sets the polarization density matrix (in spin basis along z-axis)
Definition: PolMatrices.h:35