Xped
Loading...
Searching...
No Matches
SpinSU2xX.hpp
Go to the documentation of this file.
1#ifndef XPED_SPINSU2xX_HPP_
2#define XPED_SPINSU2xX_HPP_
3
5
8
9namespace Xped {
10
11template <typename Symmetry, std::size_t order>
12class Spin;
13
14template <typename Symmetry_>
15class Spin<Sym::Combined<Sym::SU2<Sym::SpinSU2>, Symmetry_>>
16{
17 using Scalar = double;
20
21public:
22 Spin(){};
23 Spin(std::size_t D_input);
24
25 OperatorType Id_1s() const { return Id_1s_; }
26
27 OperatorType S_1s() const { return S_1s_; }
28
29 OperatorType Q_1s() const { return Q_1s_; }
30
32
33protected:
34 std::size_t D;
35
37
38 OperatorType Id_1s_; // identity
41 OperatorType Q_1s_; // quadrupole moment
42};
43
44template <typename Symmetry_>
45Spin<Sym::Combined<Sym::SU2<Sym::SpinSU2>, Symmetry_>, 0ul>::Spin(std::size_t D_input)
46 : D(D_input)
47{
48 // create basis for one Spin Site
49 typename Symmetry::qType Q = {static_cast<int>(D), Symmetry_::qvacuum()[0]};
50 basis_1s_.push_back(Q, 1);
51
52 Id_1s_ = OperatorType(Symmetry::qvacuum(), basis_1s_);
54 S_1s_ = OperatorType({3, Symmetry_::qvacuum()[0]}, basis_1s_);
55 S_1s_.data.setZero();
56
57 Scalar locS = 0.5 * static_cast<double>(D - 1);
58 S_1s_(Q, Q)(0, 0) = std::sqrt(locS * (locS + 1.));
59 Sdag_1s_ = S_1s_.adjoint();
60 Q_1s_ = std::sqrt(2.) * OperatorType::prod(S_1s_, S_1s_, {5, Symmetry_::qvacuum()[0]});
61}
62
63} // namespace Xped
64
65#endif
Definition: Qbasis.hpp:39
void push_back(const qType &q, const size_t &inner_dim)
Definition: Qbasis.cpp:32
OperatorType Id_1s() const
Definition: SpinSU2xX.hpp:25
OperatorType S_1s() const
Definition: SpinSU2xX.hpp:27
Qbasis< Symmetry, 1 > basis_1s_
Definition: SpinSU2xX.hpp:36
OperatorType Q_1s() const
Definition: SpinSU2xX.hpp:29
Qbasis< Symmetry, 1 > basis_1s() const
Definition: SpinSU2xX.hpp:31
Definition: Spin.hpp:16
OperatorType Id_1s_
Definition: Spin.hpp:62
Qbasis< Symmetry, 1 > basis_1s_
Definition: Spin.hpp:59
std::size_t D
Definition: Spin.hpp:51
Definition: bench.cpp:62
Tensor< Scalar, 1, 2, Symmetry, false > data
Definition: SiteOperator.hpp:86
static SiteOperator< Scalar, Symmetry > prod(XPED_CONST SiteOperator< Scalar, Symmetry > &O1, XPED_CONST SiteOperator< Scalar, Symmetry > &O2, const qType &target)
Definition: SiteOperator.cpp:36
void setIdentity()
Definition: SiteOperator.hpp:63
Definition: CombSym.hpp:12