Example #1
0
void Average_ekt::write_init(string & indent, ostream & os) { 
  os << indent << "EKT" << endl;
  os << indent << "NMO " << nmo << endl;
  os << indent << "NPOINTS " << npoints_eval << endl;
  if(eval_valence) { 
    os << indent << "valence band" << endl;
  }
  if(eval_conduction) { 
    os << indent << "conduction band" << endl;
  }
  if (eval_obdm) {
    os << indent << "obdm only" << endl; 
  }
  if(complex_orbitals) { 
    os << indent << "CORBITALS { \n";
    cmomat->writeinput(indent,os); 
  }
  else { 
    os << indent << "ORBITALS { \n";
    momat->writeinput(indent,os);
  }

  os << indent << "}\n";
  os << indent << "STATES { ";
  int nstates=occupations(0).GetDim(1);
  for(int i=0; i < nstates; i++) { 
    os << occupations(0)(i)+1 << " ";
    if( (i+1)%30==0) os << "\n" << indent << " ";
  }
  os << " } ";
}
Example #2
0
void doOneBeta(const EngineType& engine,
               std::vector<size_t>& ne,
               OpLibFactoryType& opLibFactory,
               size_t site,
               size_t sigma,
               RealType beta)
{
	RealType sum = 0;
	RealType sum2 = 0;
	RealType denominator = 0;
	FreeFermions::Combinations combinations(engine.size(),ne[0]);
	size_t factorToMakeItSmaller = 1;
	for (size_t i = 0; i<combinations.size(); ++i) {
		OpDiagonalFactoryType opDiagonalFactory(engine);
		EtoTheBetaHType ebh(beta,engine,0);
		DiagonalOperatorType& eibOp = opDiagonalFactory(ebh);
		
		std::vector<size_t> vTmp(engine.size(),0);
		for (size_t j=0;j<combinations(i).size();++j) vTmp[combinations(i)[j]]=1;
		std::vector<std::vector<size_t> > occupations(1,vTmp);
		HilbertStateType thisState(engine,occupations);
		HilbertStateType phi = thisState;
		eibOp.applyTo(phi);
		denominator += scalarProduct(thisState,phi)*factorToMakeItSmaller;
		LibraryOperatorType& myOp2 = opLibFactory(LibraryOperatorType::N,site,sigma);
		myOp2.applyTo(phi);
		sum += scalarProduct(thisState,phi)*factorToMakeItSmaller;
		myOp2.applyTo(phi);
		sum2 += scalarProduct(thisState,phi)*factorToMakeItSmaller;
	}
	std::cout<<beta<<" "<<sum<<" "<<denominator<<" "<<sum/denominator<<" "<<sum2/denominator<<"\n";	
}
Example #3
0
void FullInfoMetaRequestPrivate::handleWork(const DataUnit &data)
{
	readString(WorkCity, data);
	readString(WorkState, data);
	readString(WorkPhone, data);
	readString(WorkFax, data);
	readString(WorkAddress, data);
	readString(WorkZip, data);
	readField<quint16>(WorkCountry, data, countries());
	readString(WorkCompany, data);
	readString(WorkDepartment, data);
	readString(WorkPosition, data);
	readField<quint16>(WorkOccupation, data, occupations());
	readString(WorkWebpage, data);
}
Example #4
0
//----------------------------------------------------------------------
void Average_ekt::read(vector <string> & words) { 
  unsigned int pos=0;

  readvalue(words, pos=0,nmo,"NMO");
  readvalue(words,pos=0,npoints_eval,"NPOINTS");
  if(haskeyword(words, pos=0,"OBDM")) 
    eval_obdm=true; 
  else 
    eval_obdm=false;
  if(haskeyword(words, pos=0,"CONDUCTION")) 
    eval_conduction=true; 
  else 
    eval_conduction=false;
  if(haskeyword(words,pos=0,"VALENCE")) 
    eval_valence=true;
  else 
    eval_valence=false;
  if(haskeyword(words,pos=0,"CORBITALS")) 
    complex_orbitals=true;
  else 
    complex_orbitals=false;

  eval_obdm=true; 
  eval_valence=true; 
  eval_conduction=true; 
  occupations.Resize(1);
  occupations(0).Resize(nmo);
  vector <string> orbs;
  if(!readsection(words,pos=0,orbs,"STATES")) { 
    cout << "WARNING: init section does not contain states. Numbering of the density matrix may be incorrect." << endl;
    for(int i=0; i < nmo; i++) 
      occupations[0][i]=i;
  }
  else { 
    nmo=orbs.size();
    occupations[0].Resize(nmo);
    for(int i=0; i< nmo; i++) 
      occupations[0][i]=atoi(orbs[i].c_str())-1;
  }

}