Xped
Loading...
Searching...
No Matches
FermionSU2xSU2xX.hpp
Go to the documentation of this file.
1#ifndef XPED_FERMIONSSU2xSU2xU1_H_
2#define XPED_FERMIONSSU2xSU2xU1_H_
3
9
10namespace Xped {
11template <typename Symmetry>
12class Fermion;
13
14template <typename Symmetry_>
15class Fermion<Sym::Combined<Sym::SU2<Sym::SpinSU2>, Sym::SU2<Sym::SpinSU2>, Symmetry_>>
16{
17 using Scalar = double;
20 using qType = typename Symmetry::qType;
21
22public:
24 Fermion(bool REMOVE_DOUBLE, bool REMOVE_EMPTY, bool REMOVE_SINGLE, bool = true, bool CONSIDER_CHARGE = true);
25
26 OperatorType Id_1s() const { return Id_1s_; }
27 OperatorType F_1s() const { return F_1s_; }
28
29 OperatorType c_1s() const { return c_1s_; }
30 OperatorType cdag_1s() const { return cdag_1s_; }
31
32 OperatorType n_1s() const { return n_1s_; }
33 OperatorType ns_1s() const { return n_1s() - 2. * d_1s(); }
34 OperatorType nh_1s() const { return 2. * d_1s() - n_1s() + Id_1s(); }
35 OperatorType d_1s() const { return d_1s_; }
36
37 OperatorType S_1s() const { return S_1s_; }
38
39 OperatorType Tz_1s() const { return 0.5 * (n_1s() - Id_1s()); }
40 OperatorType cc_1s() const { return p_1s_; }
41 OperatorType cdagcdag_1s() const { return pdag_1s_; }
42
44
45protected:
46 void fill_basis();
48
49 std::unordered_map<std::string, std::pair<qType, std::size_t>> labels;
50 std::size_t ch_index = 0;
52
53 OperatorType Id_1s_; // identity
54 OperatorType F_1s_; // Fermionic sign
55 OperatorType c_1s_; // annihilation
57 OperatorType n_1s_; // particle number
58 OperatorType d_1s_; // double occupancy
59 OperatorType S_1s_; // orbital spin
60 OperatorType p_1s_; // pairing
61 OperatorType pdag_1s_; // pairing adjoint
62};
63
64template <typename Symmetry_>
65Fermion<Sym::Combined<Sym::SU2<Sym::SpinSU2>, Sym::SU2<Sym::SpinSU2>, Symmetry_>>::Fermion(bool, bool, bool, bool, bool CONSIDER_CHARGE)
66{
67 if(CONSIDER_CHARGE) {
68 for(std::size_t q = 0; q < Symmetry::Nq; ++q) {
69 if(Symmetry::IS_FERMIONIC[q] or Symmetry::IS_BOSONIC[q]) {
70 ch_index = q;
71 HAS_CHARGE = true;
72 break;
73 }
74 }
75 } else {
76 HAS_CHARGE = false;
77 }
78
79 fill_basis();
80 basis_1s_.sort();
81
82 // fmt::print("labels={}\n", labels);
83 // std::cout << basis_1s_.info() << std::endl << basis_1s_ << std::endl;
84
85 qType Q_c = Symmetry::qvacuum();
86 Q_c[0] = 2;
87 Q_c[1] = 2;
88 if constexpr(Symmetry::Nq > 2) { Q_c[2] = Symmetry::IS_MODULAR[2] ? util::constFct::posmod(-1, Symmetry::MOD_N[2]) : -1; }
89 qType Q_S = Symmetry::qvacuum();
90 Q_S[0] = 3;
91 Id_1s_ = OperatorType(Symmetry::qvacuum(), basis_1s_, labels);
92 Id_1s_.setIdentity();
93 F_1s_ = OperatorType(Symmetry::qvacuum(), basis_1s_, labels);
94 F_1s_.setIdentity();
95 c_1s_ = OperatorType(Q_c, basis_1s_, labels);
96 c_1s_.setZero();
97 d_1s_ = OperatorType(Symmetry::qvacuum(), basis_1s_, labels);
98 d_1s_.setZero();
99 S_1s_ = OperatorType(Q_S, basis_1s_, labels);
100 S_1s_.setZero();
101
102 // create operators one orbitals
103
104 F_1s_("single", "single") = -1.;
105
106 c_1s_("empty", "single") = std::sqrt(2.) * std::sqrt(2.);
107 c_1s_("single", "spin_double") = std::sqrt(1.5);
108 c_1s_("single", "orbital_double") = std::sqrt(1.5);
109 c_1s_("spin_double", "triple") = -std::sqrt(2);
110 c_1s_("orbital_double", "triple") = std::sqrt(2);
111 c_1s_("triple", "quadrupel") = 1.;
112 cdag_1s_ = c_1s_.adjoint();
113 n_1s_ = std::sqrt(2.) * std::sqrt(2.) * OperatorType::prod(cdag_1s_, c_1s_, Symmetry::qvacuum());
114 // S_1s_("single", "single") = std::sqrt(0.75);
115 qType Q_p = Symmetry::qvacuum();
116 if constexpr(Symmetry::Nq > 2) { Q_p[2] = Symmetry::IS_MODULAR[2] ? util::constFct::posmod(-2, Symmetry::MOD_N[2]) : -2; }
117 p_1s_ = -std::sqrt(0.5) * OperatorType::prod(c_1s_, c_1s_, Q_p); // The sign convention corresponds to c_DN c_UP
118 pdag_1s_ = p_1s_.adjoint(); // The sign convention corresponds to (c_DN c_UP)†=c_UP† c_DN†
119}
120
121template <typename Symmetry_>
123{
124 if(not HAS_CHARGE) {
125 qType Q = Symmetry::qvacuum();
126 labels.insert(std::make_pair("empty", std::make_pair(Q, 0)));
127 labels.insert(std::make_pair("quadruple", std::make_pair(Q, 1)));
128 this->basis_1s_.push_back(Q, 2);
129 Q[0] = 2;
130 Q[1] = 2;
131 this->basis_1s_.push_back(Q, 2);
132 labels.insert(std::make_pair("single", std::make_pair(Q, 0)));
133 labels.insert(std::make_pair("triple", std::make_pair(Q, 1)));
134 Q[0] = 3;
135 Q[1] = 1;
136 this->basis_1s_.push_back(Q, 1);
137 labels.insert(std::make_pair("spin_double", std::make_pair(Q, 0)));
138 Q[0] = 1;
139 Q[1] = 3;
140 this->basis_1s_.push_back(Q, 1);
141 labels.insert(std::make_pair("orbital_double", std::make_pair(Q, 0)));
142 } else {
143 qType Q = Symmetry::qvacuum();
144 this->basis_1s_.push_back(Q, 1);
145 labels.insert(std::make_pair("empty", std::make_pair(Q, 0)));
146 std::size_t dim = (Symmetry::MOD_N[ch_index] == 2 or Symmetry::MOD_N[ch_index] == 4) ? 1 : 0;
147 Q[ch_index] = Symmetry::IS_MODULAR[ch_index] ? util::constFct::posmod(4, Symmetry::MOD_N[ch_index]) : 4;
148 this->basis_1s_.push_back(Q, 1);
149 labels.insert(std::make_pair("quadrupel", std::make_pair(Q, dim)));
150
151 Q[0] = 2;
152 Q[1] = 2;
153 Q[ch_index] = 1;
154 this->basis_1s_.push_back(Q, 1);
155 labels.insert(std::make_pair("single", std::make_pair(Q, 0)));
156
157 Q[ch_index] = Symmetry::IS_MODULAR[ch_index] ? util::constFct::posmod(3, Symmetry::MOD_N[ch_index]) : 3;
158 this->basis_1s_.push_back(Q, 1);
159 dim = (Symmetry::MOD_N[ch_index] == 2) ? 1 : 0;
160 labels.insert(std::make_pair("triple", std::make_pair(Q, dim)));
161
162 Q[0] = 3;
163 Q[1] = 1;
164 Q[ch_index] = Symmetry::IS_MODULAR[ch_index] ? util::constFct::posmod(2, Symmetry::MOD_N[ch_index]) : 2;
165 this->basis_1s_.push_back(Q, 1);
166 labels.insert(std::make_pair("spin_double", std::make_pair(Q, 0)));
167 Q[0] = 1;
168 Q[1] = 3;
169 this->basis_1s_.push_back(Q, 1);
170 labels.insert(std::make_pair("orbital_double", std::make_pair(Q, 0)));
171 }
172}
173
174} // namespace Xped
175#endif // XPED_FERMIONSU2xU1_H_
Qbasis< Symmetry, 1 > basis_1s() const
Definition: FermionSU2xSU2xX.hpp:43
std::unordered_map< std::string, std::pair< qType, std::size_t > > labels
Definition: FermionSU2xSU2xX.hpp:49
Definition: Fermion.hpp:21
std::size_t ch_index
Definition: Fermion.hpp:76
OperatorType d_1s_
Definition: Fermion.hpp:93
OperatorType n_1s_
Definition: Fermion.hpp:90
OperatorType Id_1s() const
Definition: Fermion.hpp:31
Fermion()
Definition: Fermion.hpp:28
OperatorType Id_1s_
Definition: Fermion.hpp:81
OperatorType d_1s() const
Definition: Fermion.hpp:53
OperatorType n_1s() const
Definition: Fermion.hpp:45
Qbasis< Symmetry, 1 > basis_1s_
Definition: Fermion.hpp:72
void fill_basis(bool REMOVE_DOUBLE, bool REMOVE_EMPTY, bool REMOVE_SINGLE)
Definition: Fermion.hpp:208
OperatorType F_1s_
Definition: Fermion.hpp:82
Definition: Qbasis.hpp:39
constexpr int posmod(int x)
Definition: Constfct.hpp:46
Definition: bench.cpp:62
Definition: CombSym.hpp:12
Definition: SU2.hpp:43