ALPS MPS Codes
Reference documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros | Functions
special_mpos.h File Reference
#include "dmrg/mp_tensors/mpo.h"

Go to the source code of this file.

Macros

#define NGI(v)   std::make_pair(TrivialGroup::Plus, v)
 

Functions

template<class Matrix , class SymmGroup >
block_matrix< Matrix, SymmGroup > make_mpo_identity_block (Index< SymmGroup > phys_i)
 
template<class Matrix , class SymmGroup >
MPOTensor< Matrix, SymmGroup > identity_mpo (Index< SymmGroup > phys_i)
 
template<class Matrix >
MPOTensor< Matrix, TrivialGroups12_sz_mpo (Index< TrivialGroup > phys_i)
 
template<class Matrix >
MPO< Matrix, TrivialGroups12_ising (std::size_t L, double J, double h)
 
template<class Matrix >
MPO< Matrix, U1s12_heisenberg (std::size_t L, double Jxy, double Jz)
 

Macro Definition Documentation

#define NGI (   v)    std::make_pair(TrivialGroup::Plus, v)

Function Documentation

template<class Matrix , class SymmGroup >
MPOTensor<Matrix, SymmGroup> identity_mpo ( Index< SymmGroup >  phys_i)

Definition at line 44 of file special_mpos.h.

45 {
46  typedef typename Index<SymmGroup>::basis_iterator bit;
47 
49  mpo(0,0) = make_mpo_identity_block<Matrix>(phys_i);
50 
51  for (bit up = phys_i.basis_begin(); !up.end(); ++up)
52  mpo(0, 0, *up, *up) = 1;
53 
54  return mpo;
55 }
bool end() const
basis_iterator basis_begin() const
template<class Matrix , class SymmGroup >
block_matrix<Matrix, SymmGroup> make_mpo_identity_block ( Index< SymmGroup >  phys_i)

Definition at line 33 of file special_mpos.h.

34 {
36  for (std::size_t k = 0; k < phys_i.size(); ++k)
37  ret.insert_block(Matrix(phys_i[k].second, phys_i[k].second),
38  phys_i[k].first, phys_i[k].first);
39  ret *= 0;
40  return ret;
41 }
size_type insert_block(Matrix const &, charge, charge)
std::size_t size() const
template<class Matrix >
MPO<Matrix, U1> s12_heisenberg ( std::size_t  L,
double  Jxy,
double  Jz 
)

Definition at line 144 of file special_mpos.h.

145 {
146  Index<U1> phys;
147  phys.insert(std::make_pair(1, 1));
148  phys.insert(std::make_pair(-1, 1));
149 
150  block_matrix<Matrix, U1> ident, splus, sminus, sz, zero;
151 
152  ident.insert_block(boost::tuples::make_tuple(Matrix(1, 1, 1), -1, -1));
153  ident.insert_block(boost::tuples::make_tuple(Matrix(1, 1, 1), 1, 1));
154 
155  splus.insert_block(boost::tuples::make_tuple(Matrix(1, 1, 1), -1, 1));
156 
157  sminus.insert_block(boost::tuples::make_tuple(Matrix(1, 1, 1), 1, -1));
158 
159  sz.insert_block(boost::tuples::make_tuple(Matrix(1, 1, 0.5), 1, 1));
160  sz.insert_block(boost::tuples::make_tuple(Matrix(1, 1, -0.5), -1, -1));
161 
162  MPOTensor<Matrix, U1> bulk(5, 5);
163  bulk(0,0) = ident;
164  bulk(0,1) = Jxy/2*splus;
165  bulk(1,3) = sminus;
166  bulk(0,2) = Jxy/2*sminus;
167  bulk(2,3) = splus;
168  bulk(3,3) = ident;
169  bulk(0,4) = Jz*sz;
170  bulk(4,3) = sz;
171 
172  MPOTensor<Matrix, U1> left(1, 5);
173  left(0,0) = ident;
174  left(0,1) = Jxy/2*splus;
175  left(0,2) = Jxy/2*sminus;
176  left(0,4) = Jz*sz;
177 
178  MPOTensor<Matrix, U1> right(5, 1);
179  right(1,0) = sminus;
180  right(2,0) = splus;
181  right(3,0) = ident;
182  right(4,0) = sz;
183 
184  MPO<Matrix, U1> ret(L, bulk);
185  ret[0] = left;
186  ret[L-1] = right;
187 
188  return ret;
189 }
size_type insert_block(Matrix const &, charge, charge)
Definition: mpo.h:36
std::size_t insert(std::pair< charge, std::size_t > const &x)
template<class Matrix >
MPO<Matrix, TrivialGroup> s12_ising ( std::size_t  L,
double  J,
double  h 
)

Definition at line 73 of file special_mpos.h.

74 {
75  J *= 0.25;
76  h *= 0.5;
77 
78  Index<TrivialGroup> phys_i; phys_i.insert(std::make_pair(TrivialGroup::Plus, 2));
79  Index<TrivialGroup> triv; triv.insert(std::make_pair(TrivialGroup::Plus, 1));
80  Index<TrivialGroup> aux; aux.insert(std::make_pair(TrivialGroup::Plus, 4));
81 
82  MPOTensor<Matrix, TrivialGroup> bulk(4, 4), left(1, 4), right(4, 1);
83 
84  bulk(0, 0) = make_mpo_identity_block<Matrix>(phys_i);
85  bulk(1, 1) = make_mpo_identity_block<Matrix>(phys_i);
86  bulk(3, 3) = make_mpo_identity_block<Matrix>(phys_i);
87  bulk(0, 1) = make_mpo_identity_block<Matrix>(phys_i);
88  bulk(0, 2) = make_mpo_identity_block<Matrix>(phys_i);
89  bulk(2, 3) = make_mpo_identity_block<Matrix>(phys_i);
90 
91  left(0, 0) = make_mpo_identity_block<Matrix>(phys_i);
92  left(0, 1) = make_mpo_identity_block<Matrix>(phys_i);
93  left(0, 2) = make_mpo_identity_block<Matrix>(phys_i);
94 
95  right(0, 0) = make_mpo_identity_block<Matrix>(phys_i);
96  right(1, 0) = make_mpo_identity_block<Matrix>(phys_i);
97  right(2, 0) = make_mpo_identity_block<Matrix>(phys_i);
98  right(3, 0) = make_mpo_identity_block<Matrix>(phys_i);
99 
100 #define NGI(v) std::make_pair(TrivialGroup::Plus, v)
101 
102  for (int k = 0; k < 2; ++k) {
103  bulk(0, 0, NGI(k), NGI(k)) = 1;
104  bulk(1, 1, NGI(k), NGI(k)) = 1;
105  bulk(3, 3, NGI(k), NGI(k)) = 1;
106  }
107 
108  // Sz
109 
110  bulk(0, 1, NGI(0), NGI(0)) = h;
111  bulk(0, 1, NGI(1), NGI(1)) = -h;
112  // flip 1
113  bulk(0, 2, NGI(0), NGI(1)) = J;
114  bulk(0, 2, NGI(1), NGI(0)) = J;
115  // flip 2
116  bulk(2, 3, NGI(0), NGI(1)) = 1;
117  bulk(2, 3, NGI(1), NGI(0)) = 1;
118 
119  left(0, 0, NGI(0), NGI(0)) = 1;
120  left(0, 0, NGI(1), NGI(1)) = 1;
121  left(0, 1, NGI(0), NGI(0)) = h;
122  left(0, 1, NGI(1), NGI(1)) = -h;
123  left(0, 2, NGI(0), NGI(1)) = J;
124  left(0, 2, NGI(1), NGI(0)) = J;
125 
126  right(0, 0, NGI(0), NGI(0)) = h;
127  right(0, 0, NGI(1), NGI(1)) = -h;
128  right(2, 0, NGI(0), NGI(1)) = 1;
129  right(2, 0, NGI(1), NGI(0)) = 1;
130  for (int k = 0; k < 2; ++k) {
131  right(1, 0, NGI(k), NGI(k)) = 1;
132  right(3, 0, NGI(k), NGI(k)) = 1;
133  }
134 
135 #undef NGI
136 
137  MPO<Matrix, TrivialGroup> ret(L, bulk);
138  ret[0] = left;
139  ret[L-1] = right;
140  return ret;
141 }
Definition: mpo.h:36
#define NGI(v)
std::size_t insert(std::pair< charge, std::size_t > const &x)
template<class Matrix >
MPOTensor<Matrix, TrivialGroup> s12_sz_mpo ( Index< TrivialGroup phys_i)

Definition at line 58 of file special_mpos.h.

59 {
61 
63  mpo(0,0) = make_mpo_identity_block<Matrix>(phys_i);
64 
65  int s = 1;
66  for (bit up = phys_i.basis_begin(); !up.end(); ++up, s *= -1)
67  mpo(0, 0, *up, *up) = s;
68 
69  return mpo;
70 }
bool end() const
basis_iterator basis_begin() const