Commit d1e2f6f0 by Francois Gygi

added spin implementation

git-svn-id: http://qboxcode.org/svn/qb/trunk@1291 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 8584567d
......@@ -27,10 +27,9 @@ using namespace std;
int ComputeMLWFCmd::action(int argc, char **argv)
{
Wavefunction& wf = s->wf;
SlaterDet& sd = *(wf.sd(0,0));
// Check that only the k=0 point is used
if ( wf.nkp()>1 || !sd.basis().real() )
if ( wf.nkp()>1 || length(wf.kpoint(0)) != 0.0 )
{
if ( ui->onpe0() )
{
......@@ -40,39 +39,49 @@ int ComputeMLWFCmd::action(int argc, char **argv)
return 1;
}
MLWFTransform* mlwft = new MLWFTransform(sd);
mlwft->compute_transform();
mlwft->apply_transform(sd);
if ( ui->onpe0() )
cout << "<mlwfs>" << endl;
for ( int ispin = 0; ispin < wf.nspin(); ispin++ )
{
cout << " <mlwf_set size=\"" << sd.nst() << "\">" << endl;
for ( int i = 0; i < sd.nst(); i++ )
SlaterDet& sd = *(wf.sd(ispin,0));
MLWFTransform* mlwft = new MLWFTransform(sd);
mlwft->compute_transform();
mlwft->apply_transform(sd);
if ( ui->onpe0() )
{
D3vector ctr = mlwft->center(i);
double sp = mlwft->spread(i);
cout.setf(ios::fixed, ios::floatfield);
cout.setf(ios::right, ios::adjustfield);
cout << " <mlwf center=\"" << setprecision(6)
<< setw(12) << ctr.x
<< setw(12) << ctr.y
<< setw(12) << ctr.z
<< " \" spread=\" " << sp << " \"/>"
<< endl;
cout << " <mlwfset spin=\"" << ispin
<< "\" size=\"" << sd.nst() << "\">" << endl;
for ( int i = 0; i < sd.nst(); i++ )
{
D3vector ctr = mlwft->center(i);
double sp = mlwft->spread(i);
cout.setf(ios::fixed, ios::floatfield);
cout.setf(ios::right, ios::adjustfield);
cout << " <mlwf center=\"" << setprecision(6)
<< setw(12) << ctr.x
<< setw(12) << ctr.y
<< setw(12) << ctr.z
<< " \" spread=\" " << sp << " \"/>"
<< endl;
}
D3vector edipole = mlwft->dipole();
cout << " <electronic_dipole> " << edipole
<< " </electronic_dipole>" << endl;
D3vector idipole = s->atoms.dipole();
cout << " <ionic_dipole> " << idipole
<< " </ionic_dipole>" << endl;
cout << " <total_dipole> " << idipole + edipole
<< " </total_dipole>" << endl;
cout << " <total_dipole_length> " << length(idipole + edipole)
<< " </total_dipole_length>" << endl;
cout << " </mlwfset>" << endl;
}
cout << " </mlwf_set>" << endl;
D3vector edipole = mlwft->dipole();
cout << " <electronic_dipole> " << edipole
<< " </electronic_dipole>" << endl;
D3vector idipole = s->atoms.dipole();
cout << " <ionic_dipole> " << idipole
<< " </ionic_dipole>" << endl;
cout << " <total_dipole> " << idipole + edipole
<< " </total_dipole>" << endl;
cout << " <total_dipole_length> " << length(idipole + edipole)
<< " </total_dipole_length>" << endl;
delete mlwft;
}
delete mlwft;
if ( ui->onpe0() )
cout << "</mlwfs>" << endl;
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment