BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
Spinor.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Base/Spin/Spinor.h
6 //! @brief Defines class Spinor.
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_BASE_SPIN_SPINOR_H
16 #define BORNAGAIN_BASE_SPIN_SPINOR_H
17 
18 #include <heinz/Complex.h>
19 
20 class Spinor {
21 public:
22  Spinor(complex_t u_, complex_t v_);
23  static Spinor Zero();
24 
25  Spinor operator+(const Spinor&) const;
26  Spinor operator-(const Spinor&) const;
27 
28  Spinor operator*(complex_t) const;
29  Spinor operator/(complex_t) const;
30 
31  complex_t u, v;
32 };
33 
34 Spinor operator*(complex_t, const Spinor&);
35 
36 complex_t DotProduct(const Spinor& r, const Spinor& t);
37 
38 #endif // BORNAGAIN_BASE_SPIN_SPINOR_H
complex_t DotProduct(const Spinor &r, const Spinor &t)
Definition: Spinor.cpp:55
Spinor operator*(complex_t, const Spinor &)
Definition: Spinor.cpp:49
Definition: Spinor.h:20
Spinor operator-(const Spinor &) const
Definition: Spinor.cpp:33
Spinor operator*(complex_t) const
Definition: Spinor.cpp:39
complex_t v
Definition: Spinor.h:31
Spinor operator/(complex_t) const
Definition: Spinor.cpp:44
static Spinor Zero()
Definition: Spinor.cpp:23
complex_t u
Definition: Spinor.h:31
Spinor(complex_t u_, complex_t v_)
Definition: Spinor.cpp:17
Spinor operator+(const Spinor &) const
Definition: Spinor.cpp:28