BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
PolarizationHandler.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Base/Pixel/PolarizationHandler.h
6 //! @brief Defines class PolarizationHandler.
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_PIXEL_POLARIZATIONHANDLER_H
21 #define BORNAGAIN_BASE_PIXEL_POLARIZATIONHANDLER_H
22 
23 #include "Base/Vector/EigenCore.h"
24 
25 //! Convenience class for handling polarization density matrix and polarization analyzer operator
26 //! @ingroup simulation
27 
29 public:
31  PolarizationHandler(const Eigen::Matrix2cd& polarization, const Eigen::Matrix2cd& analyzer);
32 
33  //! Sets the polarization density matrix (in spin basis along z-axis)
34  void setPolarization(const Eigen::Matrix2cd& polarization) { m_polarization = polarization; }
35 
36  //! Gets the polarization density matrix (in spin basis along z-axis)
37  Eigen::Matrix2cd getPolarization() const { return m_polarization; }
38 
39  //! Sets the polarization analyzer operator (in spin basis along z-axis)
40  void setAnalyzerOperator(const Eigen::Matrix2cd& analyzer) { m_analyzer_operator = analyzer; }
41 
42  //! Gets the polarization analyzer operator (in spin basis along z-axis)
43  Eigen::Matrix2cd getAnalyzerOperator() const { return m_analyzer_operator; }
44 
45  void swapContent(PolarizationHandler& other);
46 
47 private:
48  Eigen::Matrix2cd m_polarization; //!< polarization density matrix
49  Eigen::Matrix2cd m_analyzer_operator; //!< polarization analyzer operator
50 };
51 
52 #endif // BORNAGAIN_BASE_PIXEL_POLARIZATIONHANDLER_H
53 #endif // USER_API
Include to deal with Eigen alignment centrally.
Convenience class for handling polarization density matrix and polarization analyzer operator.
Eigen::Matrix2cd getAnalyzerOperator() const
Gets the polarization analyzer operator (in spin basis along z-axis)
Eigen::Matrix2cd m_polarization
polarization density matrix
Eigen::Matrix2cd m_analyzer_operator
polarization analyzer operator
void swapContent(PolarizationHandler &other)
Eigen::Matrix2cd getPolarization() const
Gets the polarization density matrix (in spin basis along z-axis)
void setPolarization(const Eigen::Matrix2cd &polarization)
Sets the polarization density matrix (in spin basis along z-axis)
void setAnalyzerOperator(const Eigen::Matrix2cd &analyzer)
Sets the polarization analyzer operator (in spin basis along z-axis)