14template <
typename Symmetry_, std::
size_t spin_index = 0>
17 typedef double Scalar;
18 typedef Symmetry_ Symmetry;
20 using qType =
typename Symmetry::qType;
57 qType
getQ(SPINOP_LABEL Sa)
const;
60 std::unordered_map<std::string, std::pair<qType, std::size_t>>
labels;
85template <
typename Symmetry_, std::
size_t spin_index>
95template <
typename Symmetry_, std::
size_t spin_index>
101 Zero_1s_ =
OperatorType(Symmetry::qvacuum(), basis_1s_);
106 Sz_1s_ =
OperatorType(getQ(SPINOP_LABEL::SZ), basis_1s_);
107 Sp_1s_ =
OperatorType(getQ(SPINOP_LABEL::SP), basis_1s_);
108 Sm_1s_ =
OperatorType(getQ(SPINOP_LABEL::SM), basis_1s_);
110 Qz_1s_ =
OperatorType(getQ(SPINOP_LABEL::SZ), basis_1s_);
111 Qp_1s_ =
OperatorType(getQ(SPINOP_LABEL::QP), basis_1s_);
112 Qm_1s_ =
OperatorType(getQ(SPINOP_LABEL::QM), basis_1s_);
113 Qpz_1s_ =
OperatorType(getQ(SPINOP_LABEL::SP), basis_1s_);
114 Qmz_1s_ =
OperatorType(getQ(SPINOP_LABEL::SM), basis_1s_);
116 exp_i_pi_Sz_1s_ =
OperatorType(getQ(SPINOP_LABEL::SZ), basis_1s_);
117 if constexpr(Symmetry::ALL_IS_TRIVIAL) {
118 exp_i_pi_Sx_1s_ =
OperatorType(getQ(SPINOP_LABEL::SX), basis_1s_);
119 exp_i_pi_Sy_1s_ =
OperatorType(getQ(SPINOP_LABEL::iSY), basis_1s_);
125 double S = 0.5 * (D - 1);
126 std::size_t Sx2 = D - 1;
128 for(std::size_t i = 0; i < D - 1; ++i) {
129 int Q = -
static_cast<int>(Sx2) + 2 *
static_cast<int>(i);
130 double m = -S +
static_cast<double>(i);
131 Sbase(std::to_string(Q + 2), std::to_string(Q)) = 0.5 * sqrt(S * (S + 1.) - m * (m + 1.));
136 Sz_1s_ = 0.5 * (Sp_1s_ * Sm_1s_ - Sm_1s_ * Sp_1s_);
137 F_1s_ = 0.5 * Id_1s_ - Sz_1s_;
147 Qz_1s_ = 1. / sqrt(3.) * (3. * Sz_1s_ * Sz_1s_ - S * (S + 1.) * Id_1s_);
148 Qp_1s_ = Sp_1s_ * Sp_1s_;
149 Qm_1s_ = Sm_1s_ * Sm_1s_;
150 Qpz_1s_ = Sp_1s_ * Sz_1s_ + Sz_1s_ * Sp_1s_;
151 Qmz_1s_ = Sm_1s_ * Sz_1s_ + Sz_1s_ * Sm_1s_;
185template <
typename Symmetry_, std::
size_t spin_index>
189 std::size_t Sx2 = D - 1;
190 typename Symmetry::qType Q = Symmetry::qvacuum();
192 if constexpr(Symmetry::ALL_IS_TRIVIAL) {
193 basis_1s_.push_back(Q, D);
195 for(
int i = 0; i < D; ++i) {
196 int Qint = -
static_cast<int>(Sx2) + 2 *
static_cast<int>(i);
197 labels.insert(std::make_pair(std::to_string(Qint), std::make_pair(Q, i)));
199 }
else if constexpr(Symmetry::IS_SPIN[spin_index]) {
202 for(
int i = 0; i < D; ++i) {
203 int Qint = -
static_cast<int>(Sx2) + 2 *
static_cast<int>(i);
204 Q[spin_index] = Symmetry::IS_MODULAR[spin_index] ? util::constFct::posmod<Symmetry::MOD_N[spin_index]>(Qint) : Qint;
205 labels.insert(std::make_pair(std::to_string(Qint), std::make_pair(Q, basis_1s_.inner_dim(Q))));
206 basis_1s_.push_back(Q, 1);
210 basis_1s_.push_back(Q, D);
212 for(
int i = 0; i < D; ++i) {
213 int Qint = -
static_cast<int>(Sx2) + 2 *
static_cast<int>(i);
214 labels.insert(std::make_pair(std::to_string(Qint), std::make_pair(Q, i)));
219template <
typename Symmetry_, std::
size_t spin_index>
222 typename Symmetry::qType Q = Symmetry::qvacuum();
223 if constexpr(Symmetry::ALL_IS_TRIVIAL) {
225 }
else if constexpr(Symmetry::IS_SPIN[spin_index]) {
226 assert(Sa != SPINOP_LABEL::SX and Sa != SPINOP_LABEL::iSY);
227 if(Sa == SPINOP_LABEL::SZ or Sa == SPINOP_LABEL::QZ) {
229 }
else if(Sa == SPINOP_LABEL::SP or Sa == SPINOP_LABEL::QPZ) {
230 Q[spin_index] = Symmetry::IS_MODULAR[spin_index] ? util::constFct::posmod<Symmetry::MOD_N[spin_index]>(2) : 2;
231 }
else if(Sa == SPINOP_LABEL::SM or Sa == SPINOP_LABEL::QMZ) {
232 Q = Symmetry::conj(getQ(SPINOP_LABEL::SP));
233 }
else if(Sa == SPINOP_LABEL::QP) {
234 Q[spin_index] = Symmetry::IS_MODULAR[spin_index] ? util::constFct::posmod<Symmetry::MOD_N[spin_index]>(4) : 4;
235 }
else if(Sa == SPINOP_LABEL::QM) {
236 Q = Symmetry::conj(getQ(SPINOP_LABEL::QP));
Definition: Qbasis.hpp:39
OperatorType F_1s() const
Definition: Spin.hpp:28
qType getQ(SPINOP_LABEL Sa) const
Definition: Spin.hpp:220
OperatorType Qm_1s() const
Definition: Spin.hpp:40
OperatorType Sp_1s() const
Definition: Spin.hpp:34
OperatorType Qp_1s() const
Definition: Spin.hpp:39
OperatorType exp_i_pi_Sy_1s_
Definition: Spin.hpp:81
OperatorType Qmz_1s_
Definition: Spin.hpp:78
OperatorType Qz_1s_
Definition: Spin.hpp:74
OperatorType Qz_1s() const
Definition: Spin.hpp:38
void fill_SiteOps()
Definition: Spin.hpp:96
OperatorType exp_i_pi_Sz() const
Definition: Spin.hpp:46
OperatorType exp_i_pi_Sy() const
Definition: Spin.hpp:45
OperatorType Zero_1s() const
Definition: Spin.hpp:27
OperatorType Id_1s_
Definition: Spin.hpp:62
OperatorType Sp_1s_
Definition: Spin.hpp:70
Qbasis< Symmetry, 1 > basis_1s() const
Definition: Spin.hpp:48
OperatorType Sz_1s_
Definition: Spin.hpp:69
OperatorType Sm_1s_
Definition: Spin.hpp:71
OperatorType F_1s_
Definition: Spin.hpp:64
void fill_basis()
Definition: Spin.hpp:186
OperatorType Qpz_1s() const
Definition: Spin.hpp:41
Qbasis< Symmetry, 1 > basis_1s_
Definition: Spin.hpp:59
OperatorType exp_i_pi_Sx_1s_
Definition: Spin.hpp:80
OperatorType Qpz_1s_
Definition: Spin.hpp:77
OperatorType n_1s_
Definition: Spin.hpp:66
OperatorType Qp_1s_
Definition: Spin.hpp:75
std::size_t D
Definition: Spin.hpp:51
OperatorType Sm_1s() const
Definition: Spin.hpp:35
OperatorType Id_1s() const
Definition: Spin.hpp:26
OperatorType exp_i_pi_Sz_1s_
Definition: Spin.hpp:82
Spin()
Definition: Spin.hpp:23
std::unordered_map< std::string, std::pair< qType, std::size_t > > labels
Definition: Spin.hpp:60
OperatorType Zero_1s_
Definition: Spin.hpp:63
OperatorType Qmz_1s() const
Definition: Spin.hpp:42
Spin(std::size_t D_input)
Definition: Spin.hpp:86
OperatorType Qm_1s_
Definition: Spin.hpp:76
OperatorType Sz_1s() const
Definition: Spin.hpp:33
OperatorType exp_i_pi_Sx() const
Definition: Spin.hpp:44
void setZero()
Definition: SiteOperator.hpp:62
SiteOperator< Scalar, Symmetry > adjoint() XPED_CONST
Definition: SiteOperator.cpp:28