VMPS++
Loading...
Searching...
No Matches
SpinSiteSU2.h
Go to the documentation of this file.
1#ifndef SPINSITESU2_H_
2#define SPINSITESU2_H_
3
5
6#include "DmrgTypedefs.h"
7
8#include "symmetry/S1xS2.h"
9#include "symmetry/SU2.h"
10#include "symmetry/U1.h"
11
13
14template <typename Symmetry, size_t order> class SpinSite;
15
16template <>
17class SpinSite<Sym::SU2<Sym::SpinSU2>,0ul>
18{
19 typedef double Scalar;
22public:
24 SpinSite(std::size_t D_input, int mfactor_input=1);
25
26 OperatorType Id_1s() const {return Id_1s_;}
27
28 OperatorType S_1s() const {return S_1s_;}
29
30 OperatorType Q_1s() const {return Q_1s_;}
31
33protected:
34 std::size_t D;
35
37
38 OperatorType Id_1s_; //identity
41 OperatorType Q_1s_; //quadrupole moment
42};
43
45SpinSite(std::size_t D_input, int mfactor_input)
46:D(D_input)
47{
48 //create basis for one Spin Site
49 typename Symmetry::qType Q = {static_cast<int>(D)};
50 Eigen::Index inner_dim = 1;
51 std::vector<std::string> ident;
52 ident.push_back("spin");
53
54 basis_1s_.push_back(Q,inner_dim,ident);
55
56 Id_1s_ = OperatorType({1},basis_1s_,"id");
57 S_1s_ = OperatorType({3},basis_1s_,"S");
58
59 Scalar locS = 0.5*static_cast<double>(D-1);
60 S_1s_( "spin", "spin" ) = std::sqrt(locS*(locS+1.));
61 Sdag_1s_ = S_1s_.adjoint();
62 Q_1s_ = std::sqrt(2.)*OperatorType::prod(S_1s_,S_1s_,{5});
64}
65
66#endif //SPINSITESU2_H_
Definition: Qbasis.h:39
static SiteOperatorQ< Symmetry, Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > > prod(const SiteOperatorQ< Symmetry, Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > > &O1, const SiteOperatorQ< Symmetry, Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > > &O2, const qType &target)
SiteOperatorQ< Symmetry, MatrixType_ > adjoint() const
void setIdentity()
SiteOperatorQ< Symmetry, Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > > OperatorType
Definition: SpinSiteSU2.h:21
Sym::SU2< Sym::SpinSU2 > Symmetry
Definition: SpinSiteSU2.h:20
Qbasis< Symmetry > basis_1s() const
Definition: SpinSiteSU2.h:32
Qbasis< Symmetry > basis_1s_
Definition: SpinSite.h:63
std::size_t D
Definition: SpinSite.h:54
SpinSite()
Definition: SpinSite.h:24
OperatorType Id_1s_
Definition: SpinSite.h:65
SiteOperatorQ< Symmetry, Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > > OperatorType
Definition: SpinSite.h:19
Definition: SU2.h:36
Definition: qarray.h:26