BornAgain  1.18.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 scattering at grazing incidence
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 #ifndef BORNAGAIN_CORE_PIXEL_POLARIZATIONHANDLER_H
16 #define BORNAGAIN_CORE_PIXEL_POLARIZATIONHANDLER_H
17 
18 #include "Base/Vector/EigenCore.h"
19 
20 //! Convenience class for handling polarization density matrix and polarization analyzer operator
21 //! @ingroup simulation
22 
24 {
25 public:
27  PolarizationHandler(const Eigen::Matrix2cd& polarization, const Eigen::Matrix2cd& analyzer);
28 
29  //! Sets the polarization density matrix (in spin basis along z-axis)
30  void setPolarization(const Eigen::Matrix2cd& polarization) { m_polarization = polarization; }
31 
32  //! Gets the polarization density matrix (in spin basis along z-axis)
33  Eigen::Matrix2cd getPolarization() const { return m_polarization; }
34 
35  //! Sets the polarization analyzer operator (in spin basis along z-axis)
36  void setAnalyzerOperator(const Eigen::Matrix2cd& analyzer) { m_analyzer_operator = analyzer; }
37 
38  //! Gets the polarization analyzer operator (in spin basis along z-axis)
39  Eigen::Matrix2cd getAnalyzerOperator() const { return m_analyzer_operator; }
40 
41  void swapContent(PolarizationHandler& other);
42 
43 private:
44  Eigen::Matrix2cd m_polarization; //!< polarization density matrix
45  Eigen::Matrix2cd m_analyzer_operator; //!< polarization analyzer operator
46 };
47 
48 #endif // BORNAGAIN_CORE_PIXEL_POLARIZATIONHANDLER_H
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)