예제 #1
0
파일: driver.C 프로젝트: naokin/mpsxx
void prototype::Renormalize
(bool forward, const btas::QSDArray<4>& mpo0,
               const btas::QSDArray<3>& opr0,
               const btas::QSDArray<3>& bra0,
               const btas::QSDArray<3>& ket0,
                     btas::QSDArray<3>& opr1)
{
  if(forward) {
    btas::QSDArray<4> scr1;
    btas::QSDcontract(1.0, opr0, shape(0), bra0.conjugate(), shape(0), 1.0, scr1);
    btas::QSDArray<4> scr2;
    btas::QSDcontract(1.0, scr1, shape(0, 2), mpo0, shape(0, 1), 1.0, scr2);
    btas::QSDcontract(1.0, scr2, shape(0, 2), ket0, shape(0, 1), 1.0, opr1);
  }
  else {
    btas::QSDArray<4> scr1;
    btas::QSDcontract(1.0, bra0.conjugate(), shape(2), opr0, shape(0), 1.0, scr1);
    btas::QSDArray<4> scr2;
    btas::QSDcontract(1.0, scr1, shape(1, 2), mpo0, shape(1, 3), 1.0, scr2);
    btas::QSDcontract(1.0, scr2, shape(3, 1), ket0, shape(1, 2), 1.0, opr1);
  }
}
예제 #2
0
파일: driver.C 프로젝트: naokin/mpsxx
void prototype::AnalyzeTransferOperator
(              const btas::QSDArray<3>& bra,
               const btas::QSDArray<3>& ket)
{
  btas::QSDArray<4> escr;
  btas::QSDcontract(1.0, bra.conjugate(), shape(1), ket, shape(1), 1.0, escr);
  btas::QSDArray<4> eopr;
  btas::QSDpermute(escr, shape(0,2,1,3), eopr);
  btas::DiagonalQSDArray<1> sval;
  btas::QSDArray<3> lvec;
  btas::QSDArray<3> rvec;
  btas::QSDgesvd(btas::LeftCanonical, eopr, sval, lvec, rvec, 0);
  cout << "\t----------------------------------------------------------------------------------------------------" << endl;
  cout << "\ttransfer operator :: ";
  cout << setprecision(8) << fixed << eopr << endl;
  cout << "\t----------------------------------------------------------------------------------------------------" << endl;
  cout << "\tsingular values   :: ";
  cout << setprecision(8) << fixed << sval << endl;
  cout << "\t----------------------------------------------------------------------------------------------------" << endl;
}