VMPS++
Loading...
Searching...
No Matches
DmrgLinearAlgebra.h
Go to the documentation of this file.
1#ifndef STRAWBERRY_DMRGEXTERNAL_WITH_Q
2#define STRAWBERRY_DMRGEXTERNAL_WITH_Q
3
4#ifndef OXV_EXACT_INIT_M
5#define OXV_EXACT_INIT_M 100
6#endif
7
8#include "Stopwatch.h" // from HELPERS
9
10#include "Mps.h"
11#include "Mpo.h"
13#include "ParamHandler.h"
14
23template<typename Symmetry, typename Scalar>
24Scalar dot (const Mps<Symmetry,Scalar> &Vbra, const Mps<Symmetry,Scalar> &Vket)
25{
26 return Vbra.dot(Vket);
27}
28
35template<typename Symmetry, typename Scalar>
36Scalar dot_hetero (const Mps<Symmetry,Scalar> &Vbra, const Mps<Symmetry,Scalar> &Vket, int Ncellshift=0)
37{
38 if (Ncellshift==0)
39 {
40 return Vbra.dot(Vket);
41 }
42 else
43 {
44 auto Vbral = Vbra;
45 auto Vketl = Vket;
46
47 if (Ncellshift < 0) // shift Vbra to the left = elongate Vbra on the right, elongate Vket on the left
48 {
49 Vbral.elongate_hetero(0,abs(Ncellshift));
50 Vketl.elongate_hetero(abs(Ncellshift),0);
51 }
52 else
53 {
54 Vbral.elongate_hetero(abs(Ncellshift),0);
55 Vketl.elongate_hetero(0,abs(Ncellshift));
56 }
57// Vbral.shift_hetero(Ncellshift);
58
59 return Vbral.dot(Vketl);
60 }
61}
62
64template<typename Symmetry, typename Scalar>
66{
67 V1.swap(V2);
68}
69
70template<typename Symmetry, typename MpoScalar, typename Scalar>
71Array<Scalar,Dynamic,1> matrix_element (int iL,
72 int iR,
73 const Mps<Symmetry,Scalar> &Vbra,
75 const Mps<Symmetry,Scalar> &Vket,
76 size_t power_of_O = 1)
77{
78 assert(iL<O.length() and iR<O.length() and iL<iR);
79
80 Array<Scalar,Dynamic,1> res(Vket.Qmultitarget().size());
81
82 for (size_t i=0; i<Vket.Qmultitarget().size(); ++i)
83 {
87
88 vector<qarray3<Symmetry::Nq> > Qt;
90 B.setTarget(Qt);
91 Id.setVacuum();
92
93 for (int l=iR; l>=iL; --l)
94 {
95 contract_R(B, Vbra.A_at(l), O.get_W_power(power_of_O)[l], Vket.A_at(l), O.locBasis(l), O.get_qOp_power(power_of_O)[l], Bnext);
96 B.clear();
97 B = Bnext;
98 Bnext.clear();
99// cout << "l=" << l << ", i=" << i << ", B.dim=" << B.dim << endl;
100 }
101
102// if (B.dim == 1)
103// {
104// res[i] = B.block[0][0][0].trace();
105// }
106// else
107// {
108// res[i] = 0;
109// }
110 res[i] = contract_LR(Id,B);
111 }
112
113// Vbra.graph("Vbra");
114// Vket.graph("Vket");
115// cout << "dot_green=" << res.transpose() << endl;
116
117 return res;
118}
119
120template<typename Symmetry, typename Scalar>
121Array<Scalar,Dynamic,1> dot_green (const Mps<Symmetry,Scalar> &V1, const Mps<Symmetry,Scalar>&V2)
122{
123 assert(V1.length() == V2.length() and V1.locBasis() == V2.locBasis());
124 assert(V1.Qmultitarget().size() == V2.Qmultitarget().size());
125
126 return matrix_element(0, V1.length()-1, V1, Mpo<Symmetry,double>::Identity(V1.locBasis()), V2);
127}
128
129//template<typename Symmetry, typename Scalar>
130//complex<double> dot (const Mps<Symmetry,Scalar> &V1, const Mps<Symmetry,Scalar>&V2)
131//{
132// assert(V1.length() == V2.length() and V1.locBasis() == V2.locBasis());
133// assert(V1.Qmultitarget().size() == 2 and V2.Qmultitarget().size() == 2);
134//
135// VectorXd res = matrix_element(0, V1.length()-1, V1, Mpo<Symmetry,double>::Identity(V1.locBasis()), V2);
136//
137// return res(0) + 1.i * res(1);
138//}
139
148template<typename Symmetry, typename MpoScalar, typename Scalar>
149Scalar avg (const Mps<Symmetry,Scalar> &Vbra,
150 const Mpo<Symmetry,MpoScalar> &O,
151 const Mps<Symmetry,Scalar> &Vket,
152 size_t power_of_O = 1ul,
155{
159
160 Scalar out=0.;
161 // Note DMRG::DIRECTION::RIGHT now adapted for infinite boundary conditions
162 if (DIR == DMRG::DIRECTION::RIGHT)
163 {
164 vector<qarray3<Symmetry::Nq> > Qt;
165 for (size_t i=0; i<Vket.Qmultitarget().size(); ++i)
166 {
167 Qt.push_back(qarray3<Symmetry::Nq>{Vket.Qmultitarget()[i], Vbra.Qmultitarget()[i], O.Qtarget()});
168 }
169 Id.setTarget(Qt);
170
171 B.setVacuum();
172 for (size_t l=0; l<O.length(); ++l)
173 {
174 Stopwatch<> Timer;
175 contract_L(B, Vbra.A_at(l), O.get_W_power(power_of_O)[l], Vket.A_at(l), O.locBasis(l), O.get_qOp_power(power_of_O)[l], Bnext);
176 B.clear();
177 B = Bnext;
178 Bnext.clear();
179 if (CHOSEN_VERBOSITY>=2)
180 {
181 lout << "avg <Ψ|O|Ψ> L→R, l=" << l << ", mem=" << round(B.memory(GB),3) << "GB, " << Timer.info("time") << endl;
182 }
183 }
184 // cout << B.print(true) << endl;
185// return B.block[0][0][0](0,0);
186 out = contract_LR(B,Id);
187 }
188 else
189 {
190// B.setTarget(qarray3<Symmetry::Nq>{Vket.Qtarget(), Vbra.Qtarget(), O.Qtarget()});
191 vector<qarray3<Symmetry::Nq> > Qt;
192 for (size_t i=0; i<Vket.Qmultitarget().size(); ++i)
193 {
194 Qt.push_back(qarray3<Symmetry::Nq>{Vket.Qmultitarget()[i], Vbra.Qmultitarget()[i], O.Qtarget()});
195 }
196 B.setTarget(Qt);
197 Id.setVacuum();
198// B.setIdentity(1,1,Vket.outBasis(Vket.length()-1));
199
200// for (int l=O.length()-1; l>=0; --l)
201 for (size_t l=O.length()-1; l!=-1; --l)
202 {
203 Stopwatch<> Timer;
204 contract_R(B, Vbra.A_at(l), O.get_W_power(power_of_O)[l], Vket.A_at(l), O.locBasis(l), O.get_qOp_power(power_of_O)[l], Bnext);
205 B.clear();
206 B = Bnext;
207 Bnext.clear();
208 if (CHOSEN_VERBOSITY>=2)
209 {
210 lout << "avg <Ψ|O|Ψ> R→L, l=" << l << ", mem=" << round(B.memory(GB),3) << "GB, " << Timer.info("time") << endl;
211 }
212 }
213 out = contract_LR(Id,B);
214 }
215 return out;
216
217// if (B.dim == 1)
218// {
219// return B.block[0][0][0].trace();
220// }
221// else
222// {
223// /* lout << "Warning: Result of contraction in <φ|O|ψ> has several blocks, returning 0!" << endl;*/
224// /* lout << "MPS in question: " << Vket.info() << endl;*/
225// /* lout << "MPO in question: " << O.info() << endl;*/
226// /* lout << "dim=" << B.dim << endl;*/
227// /* lout << "B=" << B.print(true) << endl;*/
228// return 0;
229// }
230
231// Tripod<Nq,Matrix<Scalar,Dynamic,Dynamic> > Lnext;
232// Tripod<Nq,Matrix<Scalar,Dynamic,Dynamic> > L;
233// Tripod<Nq,Matrix<Scalar,Dynamic,Dynamic> > Rnext;
234// Tripod<Nq,Matrix<Scalar,Dynamic,Dynamic> > R;
235//
236// L.setVacuum();
237// R.setTarget(qarray3<Nq>{Vket.Qtarget(), Vbra.Qtarget(), O.Qtarget()});
238//
239// size_t last = O.length()/2;
240//
241// #pragma omp parallel sections
242// {
243// #pragma omp section
244// for (size_t l=0; l<last; ++l)
245// {
246// if (USE_SQUARE == true)
247// {
248// contract_L(L, Vbra.A_at(l), O.Wsq_at(l), Vket.A_at(l), O.locBasis(), Lnext);
249// }
250// else
251// {
252// contract_L(L, Vbra.A_at(l), O.W_at(l), Vket.A_at(l), O.locBasis(), Lnext);
253// }
254// L.clear();
255// L = Lnext;
256// Lnext.clear();
257// }
258//
259// #pragma omp section
260// for (int l=O.length()-1; l>last; --l)
261// {
262// if (USE_SQUARE == true)
263// {
264// contract_R(R, Vbra.A_at(l), O.Wsq_at(l), Vket.A_at(l), O.locBasis(), Rnext);
265// }
266// else
267// {
268// contract_R(R, Vbra.A_at(l), O.W_at(l), Vket.A_at(l), O.locBasis(), Rnext);
269// }
270// R.clear();
271// R = Rnext;
272// Rnext.clear();
273// }
274// }
275//
276// if (USE_SQUARE == true)
277// {
278// return contract_LR(L, Vbra.A_at(last), O.Wsq_at(last), Vket.A_at(last), R, O.locBasis());
279// }
280// else
281// {
282// return contract_LR(L, Vbra.A_at(last), O.W_at(last), Vket.A_at(last), R, O.locBasis());
283// }
284}
285
286template<typename Symmetry, typename MpoScalar, typename Scalar>
287Scalar avg_hetero (const Mps<Symmetry,Scalar> &Vbra,
288 const Mpo<Symmetry,MpoScalar> &O,
289 const Mps<Symmetry,Scalar> &Vket,
290 bool USE_BOUNDARY = false,
291 size_t usePower=1ul,
292 const qarray<Symmetry::Nq> &Qmid = Symmetry::qvacuum())
293{
296
297 if (USE_BOUNDARY)
298 {
300 assert(O.Qtarget() == Symmetry::qvacuum() and "Can only do avg_hetero with vacuum targets. Try OxV_exact followed by dot instead.");
301 }
302 else
303 {
304 //B.setIdentity(O.auxrows(0), 1, Vket.inBasis(0));
305 B.setIdentity(O.auxBasis(0).M(), 1, Vket.inBasis(0));
306 }
307
308 for (size_t l=0; l<O.length(); ++l)
309 {
310// if (USE_SQUARE == true)
311// {
312// contract_L(B, Vbra.A_at(l), O.Wsq_at(l), Vket.A_at(l), O.locBasis(l), O.opBasisSq(l), Bnext);
313// }
314// else
315// {
316// contract_L(B, Vbra.A_at(l), O.W_at(l), Vket.A_at(l), O.locBasis(l), O.opBasis(l), Bnext);
317// }
318
319 contract_L(B, Vbra.A_at(l), O.get_W_power(usePower)[l], Vket.A_at(l), O.locBasis(l), O.get_qOp_power(usePower)[l], Bnext);
320
321 B.clear();
322 B = Bnext;
323 Bnext.clear();
324
325// cout << "l=" << l << ", B.dim=" << B.dim << endl;
326// if (l==0)
327// {
328// cout << "B=" << endl << B.print(true) << endl << endl;
329//
330// Tripod<Symmetry,Matrix<Scalar,Dynamic,Dynamic> > R;
331// R.setIdentity(1,1,Vket.outBasis(0));
332// cout << "R.setIdentity(1,1,Vket.outBasis(0))=" << endl << R.print(true) << endl << endl;
333// }
334 }
335
337 if (USE_BOUNDARY)
338 {
339 BR = Vket.get_boundaryTensor(DMRG::DIRECTION::RIGHT, usePower);
340 }
341 else
342 {
343 //BR.setIdentity(O.auxcols(O.length()-1), 1, Vket.outBasis((O.length()-1)));
344 BR.setIdentity(O.auxBasis(O.length()).M(), 1, Vket.outBasis((O.length()-1)), Qmid);
345 }
346
347// cout << "B=" << endl;
348// cout << B.print() << endl;
349// cout << "BR=" << endl;
350// cout << BR.print() << endl;
351
352 return contract_LR(B,BR);
353}
354
364template<typename Symmetry, typename MpoScalar, typename Scalar>
365Scalar avg (const Mps<Symmetry,Scalar> &Vbra,
366 const Mpo<Symmetry,MpoScalar> &O1,
367 const Mpo<Symmetry,MpoScalar> &O2,
368 const Mps<Symmetry,Scalar> &Vket,
369 typename Symmetry::qType Qtarget = Symmetry::qvacuum(),
370 size_t usePower1=1,
371 size_t usePower2=1,
372 bool WARN=true,
374{
375 if constexpr (Symmetry::NON_ABELIAN)
376 {
380
381 vector<qarray3<Symmetry::Nq> > Qt;
382 for (size_t i=0; i<Vket.Qmultitarget().size(); ++i)
383 {
384 Qt.push_back(qarray3<Symmetry::Nq>{Vket.Qmultitarget()[i], Vbra.Qmultitarget()[i], Qtarget});
385 }
386 B.setTarget(Qt);
387 Id.setVacuum();
388
389 for (size_t l=O1.length()-1; l!=-1; --l)
390 {
391 Stopwatch<> Timer;
392 contract_R(B,
393 Vbra.A_at(l), O1.get_W_power(usePower1)[l], O2.get_W_power(usePower2)[l], Vket.A_at(l),
394 O1.locBasis(l), O1.get_qOp_power(usePower1)[l], O2.get_qOp_power(usePower2)[l],
395 Bnext);
396 B.clear();
397 B = Bnext;
398 Bnext.clear();
399 if (CHOSEN_VERBOSITY>=2)
400 {
401 lout << "avg <Ψ|O·O|Ψ> L→R, l=" << l << ", mem=" << round(B.memory(GB),3) << "GB, " << Timer.info("time") << endl;
402 }
403 }
404 return contract_LR(Id,B);
405
406 if (B.dim == 1)
407 {
408 return B.block[0][0][0].trace();
409 }
410 else
411 {
412 if (WARN)
413 {
414 lout << endl;
415 lout << "Warning: Result of contraction in <φ|O1·O2|ψ> has " << B.dim << " blocks, returning 0!" << endl;
416 lout << "MPS in question: " << Vket.info() << endl;
417 lout << "MPO1 in question: " << O1.info() << endl;
418 lout << "MPO2 in question: " << O2.info() << endl;
419 lout << endl;
420 }
421 return 0;
422 }
423 }
424 else
425 {
428
429 B.setVacuum();
430 for (size_t l=0; l<O2.length(); ++l)
431 {
432 contract_L(B, Vbra.A_at(l), O1.W_at(l), O2.W_at(l), Vket.A_at(l), O2.locBasis(l), O1.opBasis(l), O2.opBasis(l), Bnext);
433 B.clear();
434 B = Bnext;
435 Bnext.clear();
436 }
437
438 if (B.dim == 1)
439 {
440 return B.block[0][0][0].trace();
441 }
442 else
443 {
444 if (WARN)
445 {
446 lout << "Warning: Result of contraction in <φ|O1·O2|ψ> has " << B.dim << " blocks, returning 0!" << endl;
447 lout << "MPS in question: " << Vket.info() << endl;
448 lout << "MPO1 in question: " << O1.info() << endl;
449 lout << "MPO2 in question: " << O2.info() << endl;
450 }
451 return 0;
452 }
453 }
454}
455
456template<typename Symmetry, typename MpoScalar, typename Scalar>
457Scalar avg (const Mps<Symmetry,Scalar> &Vbra,
458 const vector<Mpo<Symmetry,MpoScalar>> &O,
459 const Mps<Symmetry,Scalar> &Vket,
460 size_t usePower = 1ul,
463{
464 Scalar out = 0;
465 for (int i=0; i<O.size(); ++i)
466 {
467 out += avg(Vbra, O[i], Vket, usePower, DIR, CHOSEN_VERBOSITY);
468 }
469 return out;
470}
471
472template<typename Symmetry, typename MpoScalar, typename Scalar>
473Scalar avg (const Mps<Symmetry,Scalar> &Vbra,
474 const vector<Mpo<Symmetry,MpoScalar>> &O1,
475 const vector<Mpo<Symmetry,MpoScalar>> &O2,
476 const Mps<Symmetry,Scalar> &Vket,
477 typename Symmetry::qType Qtarget = Symmetry::qvacuum(),
478 size_t usePower1 = 1ul,
479 size_t usePower2 = 1ul,
480 bool WARN=true,
482{
483 Scalar out = 0;
484 for (int i=0; i<O1.size(); ++i)
485 for (int j=0; j<O2.size(); ++j)
486 {
487 out += avg(Vbra, O1[i], O2[j], Vket, Qtarget, usePower1, usePower2, WARN, CHOSEN_VERBOSITY);
488 }
489 return out;
490}
491
499template<typename Symmetry, typename MpoScalar, typename Scalar>
501 bool VERBOSE=true, double tol_compr=1e-4, int Mincr=100, int Mlimit=10000, int max_halfsweeps=100)
502{
503 Stopwatch<> Chronos;
504
505 if (Vin.calc_Mmax() <= 4)
506 {
508 }
509 else
510 {
514 Compadre.prodCompress(H, H, Vin, Vout, Vin.Qtarget(), Vin.calc_Mmax(), Mincr, Mlimit, tol_compr, max_halfsweeps);
515 //Compadre.prodCompress(H, H, Vin, Vout, Vin.Qtarget(), Vin.calc_Mmax(), Mincr, Mlimit, tol_compr, max_halfsweeps, 1, 0, "backup", false);
516 }
517
519// double tol_compr = 1e-7;
520// OxV_exact(H, Vin, Vout, tol_compr, (VERBOSE)?DMRG::VERBOSITY::HALFSWEEPWISE:DMRG::VERBOSITY::SILENT);
521
522 if (VERBOSE)
523 {
524// lout << Compadre.info() << endl;
525 lout << Chronos.info("HxV") << endl;
526 lout << "Vout: " << Vout.info() << endl << endl;
527 }
528}
529
530template<typename Symmetry, typename MpoScalar, typename Scalar>
531void HxV (const Mpo<Symmetry,MpoScalar> &H, Mps<Symmetry,Scalar> &Vinout, bool VERBOSE = true, double tol_compr=1e-4, int Mincr=100, int Mlimit=10000, int max_halfsweeps=100)
532{
534 HxV(H,Vinout,Vtmp,VERBOSE,tol_compr,Mincr,Mlimit,max_halfsweeps);
535 Vinout = Vtmp;
536}
537
549template<typename Symmetry, typename MpoScalar, typename Scalar>
550void polyIter (const Mpo<Symmetry,MpoScalar> &H, const Mps<Symmetry,Scalar> &Vin1, double polyB,
551 const Mps<Symmetry,Scalar> &Vin2, Mps<Symmetry,Scalar> &Vout,
552 bool VERBOSE = true)
553{
554 Stopwatch<> Chronos;
555
559 Compadre.polyCompress(H,Vin1,polyB,Vin2, Vout, Vin1.calc_Mmax());
560
561 if (VERBOSE)
562 {
563 lout << Compadre.info() << endl;
564 lout << termcolor::bold << Chronos.info(make_string("polyIter B=",polyB)) << termcolor::reset << endl;
565 lout << "Vout: " << Vout.info() << endl;
566 }
567}
568
569template<typename Symmetry, typename Scalar, typename OtherScalar>
570void addScale (const OtherScalar alpha, const Mps<Symmetry,Scalar> &Vin, Mps<Symmetry,Scalar> &Vout,
572{
573 Stopwatch<> Chronos;
575 size_t Mstart = Vout.calc_Mmax();
576 vector<Mps<Symmetry,Scalar> > V(2);
577 vector<double> c(2);
578 V[0] = Vout;
579 V[1] = Vin;
580 c[0] = 1.;
581 c[1] = alpha;
582 Compadre.lincomboCompress(V, c, Vout, Vout.calc_Mmax());
583
584 if (VERBOSITY != DMRG::VERBOSITY::SILENT)
585 {
586 lout << Compadre.info() << endl;
587 lout << Chronos.info("V+V") << endl;
588 lout << "Vout: " << Vout.info() << endl << endl;
589 }
590}
591
592template<typename Symmetry, typename MpoScalar, typename Scalar>
593void OxV (const Mpo<Symmetry,MpoScalar> &H, const Mpo<Symmetry,MpoScalar> &Hdag, const Mps<Symmetry,Scalar> &Vin, Mps<Symmetry,Scalar> &Vout, bool VERBOSE=true, double tol_compr=1e-4, int Mincr=100, int Mlimit=10000, int max_halfsweeps=100, int min_halfsweeps=1, bool MEASURE_DISTANCE=true)
594{
595 Stopwatch<> Chronos;
596
597 if (Vin.calc_Mmax() <= 4)
598 {
600 }
601 else
602 {
606 Compadre.prodCompress(H, Hdag, Vin, Vout, Vin.Qtarget(), Vin.calc_Mmax(), Mincr, Mlimit, tol_compr, max_halfsweeps, min_halfsweeps, 0, "backup", MEASURE_DISTANCE);
607 }
608
610// double tol_compr = 1e-7;
611// OxV_exact(H, Vin, Vout, tol_compr, (VERBOSE)?DMRG::VERBOSITY::HALFSWEEPWISE:DMRG::VERBOSITY::SILENT);
612
613 if (VERBOSE)
614 {
615// lout << Compadre.info() << endl;
616 lout << Chronos.info("OxV") << endl;
617 lout << "Vout: " << Vout.info() << endl << endl;
618 }
619}
620
621template<typename Symmetry, typename MpoScalar, typename Scalar>
622void OxV (const Mpo<Symmetry,MpoScalar> &H, const Mpo<Symmetry,MpoScalar> &Hdag, Mps<Symmetry,Scalar> &Vinout, bool VERBOSE=true, double tol_compr=1e-4, int Mincr=100, int Mlimit=10000, int max_halfsweeps=100, int min_halfsweeps=1, bool MEASURE_DISTANCE=true)
623{
625 OxV(H,Hdag,Vinout,Vtmp,VERBOSE,tol_compr,Mincr,Mlimit,max_halfsweeps,min_halfsweeps,MEASURE_DISTANCE);
626 Vinout = Vtmp;
627}
628
629//template<typename Symmetry, typename MpoScalar, typename Scalar>
630//void OxV (const Mpo<Symmetry,MpoScalar> &O, const Mps<Symmetry,Scalar> &Vin, Mps<Symmetry,Scalar> &Vout, DMRG::BROOM::OPTION TOOL=DMRG::BROOM::SVD)
631//{
632// vector<Tripod<Symmetry,Matrix<Scalar,Dynamic,Dynamic> > > C;
633// vector<Tripod<Symmetry,Matrix<Scalar,Dynamic,Dynamic> > > Cnext;
634//
635// if (TOOL == DMRG::BROOM::QR)
636// {
637// assert(O.Qtarget() == Symmetry::qvacuum() and
638// "Need a qnumber-conserving operator in OxV for QR option!");
639// Vout = Vin;
640// }
641// else
642// {
643// Vout.outerResize(O, Vin.Qtarget()+O.Qtarget());
644// }
645//
646// contract_C0(O.locBasis(0), O.opBasis(0), O.W_at(0), Vin.A[0], C);
647// Vout.set_A_from_C(0,C,TOOL);
648//
649// for (size_t l=1; l<Vin.length(); ++l)
650// {
651// Stopwatch<> Chronos;
652// contract_C(O.locBasis(l), O.opBasis(l), Vout.A[l-1], O.W_at(l), Vin.A[l], C, Cnext);
654//
655// for (size_t s1=0; s1<O.locBasis(l).size(); ++s1)
656// {
657// C[s1].clear();
658// C[s1] = Cnext[s1];
659// Cnext[s1].clear();
660// }
661//
662// Vout.set_A_from_C(l,C,TOOL);
664// }
665//
666// Vout.mend();
667// Vout.pivot = Vout.length()-1;
668//
702//}
703
704//template<typename Symmetry, typename MpoScalar, typename Scalar>
705//void OxV (const Mpo<Symmetry,MpoScalar> &O, Mps<Symmetry,Scalar> &Vinout, DMRG::BROOM::OPTION TOOL)
706//{
707// Mps<Symmetry,Scalar> Vtmp;
708// OxV(O,Vinout,Vtmp,TOOL);
709// Vinout = Vtmp;
710//}
711
720// Note: Changes to the function parameters here affect the forward declaration in Mps.h
721template<typename Symmetry, typename MpoScalar, typename Scalar>
723 double tol_compr = 1e-7, DMRG::VERBOSITY::OPTION VERBOSITY = DMRG::VERBOSITY::HALFSWEEPWISE,
724 int max_halfsweeps = 200, int min_halfsweeps = 1, int Minit=-1,
726{
727 size_t L = Vin.length();
728 auto Qt = Symmetry::reduceSilent(Vin.Qtarget(), O.Qtarget());
729 bool TRIVIAL_BOUNDARIES = false;
730 if (Vin.Boundaries.IS_TRIVIAL()) {TRIVIAL_BOUNDARIES = true;}
731
732// for (int i=0; i<Qt.size(); ++i)
733// {
734// cout << "i=" << i << ", Qt[i]=" << Qt[i] << endl;
735// }
736
737 Vout = Mps<Symmetry,Scalar>(L, Vin.locBasis(), Qt[Qt.size()-1], O.volume(), 100ul, TRIVIAL_BOUNDARIES);
738 Vout.set_Qmultitarget(Qt);
739 Vout.min_Nsv = Vin.min_Nsv;
740 Vout.N_phys = Vin.N_phys;
741
742 if (Vin.Boundaries.IS_TRIVIAL())
743 {
744 Vout.set_open_bc();
745 }
746 else
747 {
748 Vout.Boundaries = Vin.Boundaries;
749 }
750
751 // FORCE_QTOT to create only one final block;
752 // otherwise crashes when using the result for further calculations (e.g. ground-state sweeping).
753 // Irrelevant for infinite boundary conditions.
754 for (size_t l=0; l<L; ++l)
755 {
756 bool FORCE_QTOT = (l!=L-1 or TRIVIAL_BOUNDARIES==false)? false:true;
757 contract_AW(Vin.A_at(l), Vin.locBasis(l), O.W_at(l), O.opBasis(l),
758 Vin.inBasis(l) , O.inBasis(l),
759 Vin.outBasis(l), O.outBasis(l),
760 Vout.A_at(l),
761 FORCE_QTOT, Vout.Qtarget());
762 }
763
764 Vout.update_inbase();
765 Vout.update_outbase();
766 Vout.calc_Qlimits(); // Must be called here, depends on Qtot!
767
768 string input_info, exact_info, swept_info, compressed_info, Compressor_info;
769
770 if (VERBOSITY > DMRG::VERBOSITY::SILENT)
771 {
772// lout << endl;
773// lout << termcolor::bold << "OxV_exact" << termcolor::reset << endl;
774 input_info = Vin.info();
775 exact_info = Vout.info();
776// lout << "input:\t" << Vin.info() << endl;
777// lout << "exact:\t" << Vout.info() << endl;
778 }
779
780 if (tol_compr < 1.)
781 {
784 Compadre.stateCompress(Vout, Vtmp, (Minit==-1)?Vin.calc_Mmax():Minit, 100, 10000, tol_compr, max_halfsweeps, min_halfsweeps);
785 Vtmp.max_Nsv = Vtmp.calc_Mmax();
786
787// lout << "Vtmp.calc_Mmax()=" << Vtmp.calc_Mmax() << endl;
788 if (Vtmp.calc_Mmax() == 0)
789 {
790 lout << termcolor::red << "Warning: OxV compression failed, returning exact result!" << termcolor::reset << endl;
791 Vout.sweep(0,BROOMOPTION);
792 }
793 else
794 {
795 Vout = Vtmp;
796 // shouldn't matter, but just to be sure:
797 Vout.update_inbase();
798 Vout.update_outbase();
799 Vout.calc_Qlimits(); // Careful: Depends on Qtot!
800
801 if (VERBOSITY > DMRG::VERBOSITY::SILENT)
802 {
803 compressed_info = Vout.info();
804 Compressor_info = Compadre.info();
805 // lout << "compressed:\t" << Vout.info() << endl;
806 // lout << "\t" << Compadre.info() << endl;
807 }
808 }
809 }
810 else
811 {
812// cout << Vout.info() << endl;
813// cout << "dot=" << dot(Vout,Vout) << endl;
814 Vout.sweep(0,BROOMOPTION);
815
816 if (VERBOSITY > DMRG::VERBOSITY::SILENT)
817 {
818// lout << "swept:\t" << Vout.info() << endl;
819 swept_info = Vout.info();
820 }
821 }
822
823 if (VERBOSITY > DMRG::VERBOSITY::SILENT)
824 {
825 #pragma omp critical
826 {
827 lout << endl;
828 lout << termcolor::bold << "OxV_exact" << termcolor::reset << endl;
829 lout << "input:\t" << input_info << endl;
830 lout << "oper.:\t" << O.info() << endl;
831 lout << "exact:\t" << exact_info << endl;
832 if (tol_compr < 1.)
833 {
834 lout << "compr.:\t" << compressed_info << endl;
835 lout << "\t" << Compressor_info << endl;
836 }
837 else
838 {
839 lout << "swept:\t" << swept_info << endl;
840 }
841 lout << endl;
842 }
843 }
844
845 if (Vout.calc_Nqavg() <= 1.5 and Vout.min_Nsv == 0 and
846 Symmetry::IS_TRIVIAL == false and
847 Vout.Boundaries.IS_TRIVIAL() == true)
848 {
849 Vout.min_Nsv = 1;
850 lout << termcolor::blue << "Warning: Setting min_Nsv=1 to deal with small Hilbert space after OxV_exact!" << termcolor::reset << endl;
851 }
852}
853
854template<typename Symmetry, typename MpoScalar, typename Scalar>
856 double tol_compr = 1e-7, DMRG::VERBOSITY::OPTION VERBOSITY = DMRG::VERBOSITY::HALFSWEEPWISE,
857 int max_halfsweeps = 200, int min_halfsweeps = 1, int Minit=-1,
859{
861 OxV_exact(O,Vinout,Vtmp,tol_compr,VERBOSITY,max_halfsweeps,min_halfsweeps,Minit,BROOMOPTION);
862 Vinout = Vtmp;
863}
864
865template<typename Hamiltonian, typename Scalar>
866Hamiltonian sum (const Hamiltonian &H1, const Hamiltonian &H2, DMRG::VERBOSITY::OPTION VERBOSITY = DMRG::VERBOSITY::SILENT)
867{
869 Terms1.set_verbosity(VERBOSITY);
871 Terms2.set_verbosity(VERBOSITY);
872 MpoTerms<typename Hamiltonian::Symmetry,Scalar> Sum_asTerms = Hamiltonian::sum(Terms1,Terms2);
873 Mpo<typename Hamiltonian::Symmetry,Scalar> Sum_asMpo(Sum_asTerms);
874 vector<Param> params;
875 Hamiltonian Hres(Sum_asMpo,params);
876 return Hres;
877}
878
879template<typename Hamiltonian, typename Scalar>
880Hamiltonian prod (const Hamiltonian &H1, const Hamiltonian &H2, const qarray<Hamiltonian::Symmetry::Nq> &Qtot=Hamiltonian::Symmetry::qvacuum(), DMRG::VERBOSITY::OPTION VERBOSITY = DMRG::VERBOSITY::SILENT)
881{
883 Terms1.set_verbosity(VERBOSITY);
885 Terms2.set_verbosity(VERBOSITY);
886 MpoTerms<typename Hamiltonian::Symmetry,Scalar> Prod_asTerms = Hamiltonian::prod(Terms1,Terms2,Qtot);
887 Mpo<typename Hamiltonian::Symmetry,Scalar> Prod_asMpo(Prod_asTerms);
888 vector<Param> params; // needs a better solution: params contains info on Ly and states projected out of the basis
889 Hamiltonian Hres(Prod_asMpo,params);
890 return Hres;
891}
892
893template<typename Symmetry, typename Scalar=double>
895{
897 if ( H1.HAS_W() and !H2.HAS_W()) res = H1;
898 else if (!H1.HAS_W() and H2.HAS_W()) res = H2;
899 else
900 {
901 MpoTerms<Symmetry,Scalar> Terms1 = H1;
902 Terms1.set_verbosity(VERBOSITY);
903 Terms1.calc(1);
904 MpoTerms<Symmetry,Scalar> Terms2 = H2;
905 Terms2.set_verbosity(VERBOSITY);
906 Terms2.calc(1);
908 res = Mpo<Symmetry,Scalar>(Sum_asTerms);
909 }
910 return res;
911}
912
913template<typename Symmetry, typename Scalar=double>
915{
916
918 if ( H1.HAS_W() and !H2.HAS_W()) res = H1;
919 else if (!H1.HAS_W() and H2.HAS_W())
920 {
921 MpoTerms<Symmetry,Scalar> minusH2 = H2;
922 minusH2.scale(-1.);
923 res = Mpo<Symmetry,Scalar>(minusH2);
924 }
925 else
926 {
927 MpoTerms<Symmetry,Scalar> Terms1 = H1;
928 Terms1.set_verbosity(VERBOSITY);
929 Terms1.calc(1);
930 auto minusH2 = H2;
931 minusH2.scale(-1.);
932 MpoTerms<Symmetry,Scalar> Terms2 = minusH2;
933 Terms2.set_verbosity(VERBOSITY);
934 Terms2.calc(1);
935 MpoTerms<Symmetry,Scalar> Diff_asTerms = MpoTerms<Symmetry,Scalar>::sum(Terms1,Terms2);
936 res = Mpo<Symmetry,Scalar>(Diff_asTerms);
937 }
938 return res;
939}
940
941template<typename Symmetry, typename Scalar=double>
943{
944 MpoTerms<Symmetry,Scalar> Terms1 = H1;
945 Terms1.set_verbosity(VERBOSITY);
946 MpoTerms<Symmetry,Scalar> Terms2 = H2;
947 Terms2.set_verbosity(VERBOSITY);
948 MpoTerms<Symmetry,Scalar> Prod_asTerms = MpoTerms<Symmetry,Scalar>::prod(Terms1,Terms2,Qtot);
949 Mpo<Symmetry,Scalar> Prod_asMpo(Prod_asTerms);
950 return Prod_asMpo;
951}
952
953template<typename Symmetry, typename MpsScalar=double, typename MpoScalar=double>
954void OvecxV(const std::vector<Mpo<Symmetry,MpoScalar>>& Os, Mps<Symmetry,MpsScalar>& v_in, std::size_t Minit_in=0ul, std::size_t Mincr=100ul, std::size_t Mlimit=10000ul, double tol_compr=1e-5, std::size_t max_halfsweeps=24ul, std::size_t min_halfsweeps=1ul)
955{
956 assert(Os.size() > 0);
957 Mps<Symmetry,MpsScalar> v_other = v_in;
958 std::size_t Minit = Minit_in;
959 if(Minit_in == 0ul)
960 {
961 Minit = v_in.calc_Mmax();
962 }
963 assert(Os[0].IS_UNITARY() and "Unitarity is needed for this method");
965 Compadre.prodCompress(Os[0], Os[0], v_in, v_other, Symmetry::qvacuum(), Minit, Mincr, Mlimit, tol_compr, max_halfsweeps, min_halfsweeps);
966 for (std::size_t k=1; k<Os.size(); ++k)
967 {
968 Mps<Symmetry,MpsScalar> &v_old = (k % 2 == 1 ? v_other : v_in);
969 Mps<Symmetry,MpsScalar> &v_new = (k % 2 == 1 ? v_in : v_other);
970
971 if(Minit_in == 0ul)
972 {
973 Minit = v_old.calc_Mmax();
974 }
975 assert(Os[k].IS_UNITARY() and "Unitarity is needed for this method");
977 Compadre.prodCompress(Os[k], Os[k], v_old, v_new, Symmetry::qvacuum(), Minit, Mincr, Mlimit, tol_compr, max_halfsweeps, min_halfsweeps);
978 }
979 if(Os.size() % 2 == 1)
980 {
981 v_in = v_other;
982 }
983}
984
985#endif
void contract_AW(const vector< Biped< Symmetry, Matrix< Scalar, Dynamic, Dynamic > > > &Ain, const vector< qarray< Symmetry::Nq > > &qloc, const vector< vector< vector< Biped< Symmetry, MpoMatrixType > > > > &W, const vector< qarray< Symmetry::Nq > > &qOp, const Qbasis< Symmetry > &qauxAl, const Qbasis< Symmetry > &qauxWl, const Qbasis< Symmetry > &qauxAr, const Qbasis< Symmetry > &qauxWr, vector< Biped< Symmetry, Matrix< Scalar, Dynamic, Dynamic > > > &Aout, bool FORCE_QTOT=false, qarray< Symmetry::Nq > Qtot=Symmetry::qvacuum())
Scalar dot(const Mps< Symmetry, Scalar > &Vbra, const Mps< Symmetry, Scalar > &Vket)
void polyIter(const Mpo< Symmetry, MpoScalar > &H, const Mps< Symmetry, Scalar > &Vin1, double polyB, const Mps< Symmetry, Scalar > &Vin2, Mps< Symmetry, Scalar > &Vout, bool VERBOSE=true)
void addScale(const OtherScalar alpha, const Mps< Symmetry, Scalar > &Vin, Mps< Symmetry, Scalar > &Vout, DMRG::VERBOSITY::OPTION VERBOSITY=DMRG::VERBOSITY::SILENT)
Array< Scalar, Dynamic, 1 > dot_green(const Mps< Symmetry, Scalar > &V1, const Mps< Symmetry, Scalar > &V2)
Hamiltonian sum(const Hamiltonian &H1, const Hamiltonian &H2, DMRG::VERBOSITY::OPTION VERBOSITY=DMRG::VERBOSITY::SILENT)
void OxV(const Mpo< Symmetry, MpoScalar > &H, const Mpo< Symmetry, MpoScalar > &Hdag, const Mps< Symmetry, Scalar > &Vin, Mps< Symmetry, Scalar > &Vout, bool VERBOSE=true, double tol_compr=1e-4, int Mincr=100, int Mlimit=10000, int max_halfsweeps=100, int min_halfsweeps=1, bool MEASURE_DISTANCE=true)
Hamiltonian prod(const Hamiltonian &H1, const Hamiltonian &H2, const qarray< Hamiltonian::Symmetry::Nq > &Qtot=Hamiltonian::Symmetry::qvacuum(), DMRG::VERBOSITY::OPTION VERBOSITY=DMRG::VERBOSITY::SILENT)
void swap(Mps< Symmetry, Scalar > &V1, Mps< Symmetry, Scalar > &V2)
Scalar avg_hetero(const Mps< Symmetry, Scalar > &Vbra, const Mpo< Symmetry, MpoScalar > &O, const Mps< Symmetry, Scalar > &Vket, bool USE_BOUNDARY=false, size_t usePower=1ul, const qarray< Symmetry::Nq > &Qmid=Symmetry::qvacuum())
Scalar dot_hetero(const Mps< Symmetry, Scalar > &Vbra, const Mps< Symmetry, Scalar > &Vket, int Ncellshift=0)
void OvecxV(const std::vector< Mpo< Symmetry, MpoScalar > > &Os, Mps< Symmetry, MpsScalar > &v_in, std::size_t Minit_in=0ul, std::size_t Mincr=100ul, std::size_t Mlimit=10000ul, double tol_compr=1e-5, std::size_t max_halfsweeps=24ul, std::size_t min_halfsweeps=1ul)
Scalar avg(const Mps< Symmetry, Scalar > &Vbra, const Mpo< Symmetry, MpoScalar > &O, const Mps< Symmetry, Scalar > &Vket, size_t power_of_O=1ul, DMRG::DIRECTION::OPTION DIR=DMRG::DIRECTION::RIGHT, DMRG::VERBOSITY::OPTION CHOSEN_VERBOSITY=DMRG::VERBOSITY::SILENT)
void OxV_exact(const Mpo< Symmetry, MpoScalar > &O, const Mps< Symmetry, Scalar > &Vin, Mps< Symmetry, Scalar > &Vout, double tol_compr=1e-7, DMRG::VERBOSITY::OPTION VERBOSITY=DMRG::VERBOSITY::HALFSWEEPWISE, int max_halfsweeps=200, int min_halfsweeps=1, int Minit=-1, DMRG::BROOM::OPTION BROOMOPTION=DMRG::BROOM::QR)
Array< Scalar, Dynamic, 1 > matrix_element(int iL, int iR, const Mps< Symmetry, Scalar > &Vbra, const Mpo< Symmetry, MpoScalar > &O, const Mps< Symmetry, Scalar > &Vket, size_t power_of_O=1)
Mpo< Symmetry, Scalar > diff(const Mpo< Symmetry, Scalar > &H1, const Mpo< Symmetry, Scalar > &H2, DMRG::VERBOSITY::OPTION VERBOSITY=DMRG::VERBOSITY::SILENT)
void HxV(const Mpo< Symmetry, MpoScalar > &H, const Mps< Symmetry, Scalar > &Vin, Mps< Symmetry, Scalar > &Vout, bool VERBOSE=true, double tol_compr=1e-4, int Mincr=100, int Mlimit=10000, int max_halfsweeps=100)
@ B
Definition: DmrgTypedefs.h:130
void sweep(size_t loc, DMRG::BROOM::OPTION TOOL, PivotMatrixType *H=NULL)
Definition: DmrgJanitor.h:198
size_t max_Nsv
Definition: DmrgJanitor.h:98
size_t length() const
Definition: DmrgJanitor.h:92
size_t min_Nsv
Definition: DmrgJanitor.h:98
static MpoTerms< Symmetry, Scalar > prod(const MpoTerms< Symmetry, Scalar > &top, const MpoTerms< Symmetry, Scalar > &bottom, const qType &qTot, const double tolerance=::mynumeric_limits< double >::epsilon())
Definition: MpoTerms.h:3289
const Qbasis< Symmetry > & outBasis(const std::size_t loc) const
Definition: MpoTerms.h:708
void set_verbosity(const DMRG::VERBOSITY::OPTION VERB_in)
Definition: MpoTerms.h:881
const std::vector< std::vector< std::vector< Biped< Symmetry, MatrixType > > > > & W_at(const std::size_t loc) const
Definition: MpoTerms.h:699
void scale(const Scalar factor, const Scalar offset=0., const std::size_t power=0ul, const double tolerance=1.e-14)
Definition: MpoTerms.h:2857
static MpoTerms< Symmetry, Scalar > sum(const MpoTerms< Symmetry, Scalar > &top, const MpoTerms< Symmetry, Scalar > &bottom, const double tolerance=::mynumeric_limits< double >::epsilon())
Definition: MpoTerms.h:3666
std::size_t size() const
Definition: MpoTerms.h:610
const std::vector< std::vector< qType > > & locBasis() const
Definition: MpoTerms.h:702
void calc(const std::size_t power)
Definition: MpoTerms.h:1135
const Qbasis< Symmetry > & inBasis(const std::size_t loc) const
Definition: MpoTerms.h:707
const std::vector< std::vector< std::vector< std::vector< Biped< Symmetry, MatrixType > > > > > & get_W_power(std::size_t power) const
Definition: MpoTerms.h:2797
const std::vector< std::vector< qType > > & get_qOp_power(std::size_t power) const
Definition: MpoTerms.h:2828
const std::vector< std::vector< qType > > & opBasis() const
Definition: MpoTerms.h:710
const qType & Qtarget() const
Definition: MpoTerms.h:713
const std::vector< Qbasis< Symmetry > > & auxBasis() const
Definition: MpoTerms.h:705
Definition: Mpo.h:40
std::size_t volume() const
Definition: Mpo.h:114
std::size_t length() const
Definition: Mpo.h:112
std::string info(bool REDUCED=false) const
bool HAS_W() const
Definition: Mpo.h:143
string info() const
void prodCompress(const MpOperator &H, const MpOperator &Hdag, const Mps< Symmetry, Scalar > &Vin, Mps< Symmetry, Scalar > &Vout, qarray< Symmetry::Nq > Qtot_input, size_t Minit, size_t Mincr=100, size_t Mlimit=10000, double tol=1e-4, size_t max_halfsweeps=100, size_t min_halfsweeps=1, std::size_t savePeriod=0, std::string saveName="backup", bool MEASURE_DISTANCE=true, const MpOperator *HdagH=NULL)
void lincomboCompress(const vector< Mps< Symmetry, Scalar > > &Vin, const vector< Scalar > &factors, Mps< Symmetry, Scalar > &Vout, const Mps< Symmetry, Scalar > &Vguess, size_t Minit, size_t Mincr=100, size_t Mlimit=10000, double tol=1e-4, size_t max_halfsweeps=40, size_t min_halfsweeps=1)
void polyCompress(const MpOperator &H, const Mps< Symmetry, Scalar > &Vin1, double polyB, const Mps< Symmetry, Scalar > &Vin2, Mps< Symmetry, Scalar > &Vout, size_t Minit, size_t Mincr=100, size_t Mlimit=10000, double tol=DMRG_POLYCOMPRESS_TOL, size_t max_halfsweeps=DMRG_POLYCOMPRESS_MAX, size_t min_halfsweeps=DMRG_POLYCOMPRESS_MIN)
void stateCompress(const Mps< Symmetry, Scalar > &Vin, Mps< Symmetry, Scalar > &Vout, size_t Minit, size_t Mincr=100, size_t Mlimit=10000, double tol=1e-4, size_t max_halfsweeps=40, size_t min_halfsweeps=1)
Definition: Mps.h:39
vector< qarray< Nq > > locBasis(size_t loc) const
Definition: Mps.h:444
void elongate_hetero(size_t Nleft=0, size_t Nright=0)
Definition: Mps.h:506
void set_Qmultitarget(const vector< qarray< Nq > > &Qmulti_input)
Definition: Mps.h:206
Tripod< Symmetry, Matrix< Scalar, Dynamic, Dynamic > > get_boundaryTensor(DMRG::DIRECTION::OPTION DIR, size_t usePower=1ul) const
Definition: Mps.h:488
Scalar dot(const Mps< Symmetry, Scalar > &Vket) const
const vector< Biped< Symmetry, MatrixType > > & A_at(size_t loc) const
Definition: Mps.h:456
void calc_Qlimits()
double calc_Nqavg() const
MpsBoundaries< Symmetry, Scalar > Boundaries
Definition: Mps.h:481
void update_inbase(size_t loc)
string info() const
size_t N_phys
Definition: Mps.h:612
void update_outbase(size_t loc)
void set_open_bc()
Definition: Mps.h:483
Qbasis< Symmetry > inBasis(size_t loc) const
Definition: Mps.h:448
size_t calc_Mmax() const
void swap(Mps< Symmetry, Scalar > &V)
vector< qarray< Nq > > Qmultitarget() const
Definition: Mps.h:441
Qbasis< Symmetry > outBasis(size_t loc) const
Definition: Mps.h:452
qarray< Nq > Qtarget() const
Definition: Mps.h:438
void contract_R(const Tripod< Symmetry, MatrixType2 > &Rold, const vector< Biped< Symmetry, MatrixType > > &Abra, const vector< vector< vector< Biped< Symmetry, MpoMatrixType > > > > &W, const vector< Biped< Symmetry, MatrixType > > &Aket, const vector< qarray< Symmetry::Nq > > &qloc, const vector< qarray< Symmetry::Nq > > &qOp, Tripod< Symmetry, MatrixType2 > &Rnew, bool RANDOMIZE=false, tuple< CONTRACT_LR_MODE, size_t > MODE_input=make_pair(FULL, 0), const std::unordered_map< pair< qarray< Symmetry::Nq >, size_t >, size_t > &basis_order_map={})
void contract_L(const Tripod< Symmetry, MatrixType2 > &Lold, const vector< Biped< Symmetry, MatrixType > > &Abra, const vector< vector< vector< Biped< Symmetry, MpoMatrixType > > > > &W, const vector< Biped< Symmetry, MatrixType > > &Aket, const vector< qarray< Symmetry::Nq > > &qloc, const vector< qarray< Symmetry::Nq > > &qOp, Tripod< Symmetry, MatrixType2 > &Lnew, bool RANDOMIZE=false, tuple< CONTRACT_LR_MODE, size_t > MODE_input=make_pair(FULL, 0), const std::unordered_map< pair< qarray< Symmetry::Nq >, size_t >, size_t > &basis_order_map={})
Scalar contract_LR(const Tripod< Symmetry, Matrix< Scalar, Dynamic, Dynamic > > &L, const vector< Biped< Symmetry, Matrix< Scalar, Dynamic, Dynamic > > > &Abra, const vector< vector< vector< Biped< Symmetry, MpoMatrixType > > > > &W, const vector< Biped< Symmetry, Matrix< Scalar, Dynamic, Dynamic > > > &Aket, const Tripod< Symmetry, Matrix< Scalar, Dynamic, Dynamic > > &R, const vector< qarray< Symmetry::Nq > > &qloc, const vector< qarray< Symmetry::Nq > > &qOp)
std::array< qarray< Nq >, 3 > qarray3
Definition: qarray.h:52
void clear()
Definition: Multipede.h:409
void setVacuum()
Definition: Multipede.h:463
void setTarget(std::array< qType, Nlegs > Q)
Definition: Multipede.h:480
void push_back(std::array< qType, Nlegs > quple, const boost::multi_array< MatrixType, LEGLIMIT > &M)
Definition: Multipede.h:439
void setIdentity(size_t Drows, size_t Dcols, size_t amax=1, size_t bmax=1)
Definition: Multipede.h:509
Definition: qarray.h:26