Commit 6734bf55 by Francois Gygi

Merge branch 'develop'

parents 45ca6412 260b6bec
......@@ -244,9 +244,9 @@ class D3tensor
double norm2(const D3tensor& a) const
{
return a_[0]*a_[0] + a_[1]*a_[1] + a_[2]*a_[2] +
a_[3]*a_[3] + a_[4]*a_[4] + a_[5]*a_[5] +
a_[6]*a_[6] + a_[7]*a_[7] + a_[8]*a_[8];
return a[0]*a[0] + a[1]*a[1] + a[2]*a[2] +
a[3]*a[3] + a[4]*a[4] + a[5]*a[5] +
a[6]*a[6] + a[7]*a[7] + a[8]*a[8];
}
double norm(const D3tensor& a) const
......
......@@ -356,7 +356,6 @@ void ExchangeOperator::apply_VXC_(double mix, Wavefunction& wf_ref,
////////////////////////////////////////////////////////////////////////////////
void ExchangeOperator::apply_operator(Wavefunction& dwf)
{
cout << "ExchangeOperator::apply_operator" << endl;
// apply sigmaHF to s_.wf and store result in dwf
// use the reference function wf0_ and reference sigma(wf) dwf0_
apply_VXC_(1.0, wf0_, dwf0_, dwf);
......
......@@ -2025,6 +2025,7 @@ double DoubleMatrix::det_from_lu(valarray<int> ipiv)
return det;
}
return 0.0;
}
////////////////////////////////////////////////////////////////////////////////
......@@ -2041,6 +2042,7 @@ double DoubleMatrix::inverse_det(void)
inverse_from_lu(ipiv);
return det;
}
return 0.0;
}
////////////////////////////////////////////////////////////////////////////////
......@@ -2131,6 +2133,7 @@ complex<double> ComplexMatrix::det_from_lu(valarray<int> ipiv)
return det;
}
return complex<double>(0.0,0.0);
}
////////////////////////////////////////////////////////////////////////////////
......@@ -2147,6 +2150,7 @@ complex<double> ComplexMatrix::inverse_det(void)
inverse_from_lu(ipiv);
return det;
}
return complex<double>(0.0,0.0);
}
////////////////////////////////////////////////////////////////////////////////
......@@ -2814,7 +2818,7 @@ void DoubleMatrix::syev(char uplo, valarray<double>& w, DoubleMatrix& z)
z.val, &ione, &ione, z.desc_, &tmpwork, &lwork,
&info);
lwork = (int) (tmpwork + 0.1);
lwork = (int) (tmpwork + 1);
double* work=new double[lwork];
pdsyev(&jobz, &uplo, &m_, val, &ione, &ione, desc_, &w[0],
z.val, &ione, &ione, z.desc_, work, &lwork,
......@@ -2871,7 +2875,7 @@ void DoubleMatrix::syevd(char uplo, valarray<double>& w, DoubleMatrix& z)
z.val, &ione, &ione, z.desc_, &tmpwork, &lwork,
&tmpiwork, &liwork, &info);
lwork = (int) (tmpwork + 0.1);
lwork = (int) (tmpwork + 1);
double* work=new double[lwork];
liwork = tmpiwork;
int* iwork = new int[liwork];
......@@ -2943,7 +2947,7 @@ void DoubleMatrix::syevx(char uplo, valarray<double>& w, DoubleMatrix& z,
assert(info==0);
lwork = (int) (tmpwork + 0.1);
lwork = (int) (tmpwork + 1);
double* work=new double[lwork];
liwork = tmpiwork;
int* iwork = new int[liwork];
......@@ -3061,7 +3065,7 @@ void DoubleMatrix::syevd(char uplo, valarray<double>& w)
zval, &ione, &ione, descz, &tmpwork, &lwork,
&tmpiwork, &liwork, &info);
lwork = (int) (tmpwork + 0.1);
lwork = (int) (tmpwork + 1);
double* work=new double[lwork];
liwork = tmpiwork;
int* iwork = new int[liwork];
......
......@@ -2,33 +2,33 @@
# Copyright 2016 The Regents of the University of California
# This file is part of Qbox
#
# qbox_xyz.py: extract first (or all) set(s) of atomic positions in xyz format
# qbox_xyz.py: extract sets of atomic positions in xyz format
# from a Qbox output file or from a Qbox sample file using SAX
# incremental parsing
#
# use: qbox_xyz.py [-all] {file|URL}
# use: qbox_xyz.py [-first] {file|URL}
import os.path
import xml.sax
import sys
import urllib2
def usage():
print "use: ",sys.argv[0]," [-all] {file|URL}"
print "use: ",sys.argv[0]," [-first] {file|URL}"
sys.exit()
argc=len(sys.argv)
if ( argc < 2 or argc > 3 ):
usage()
# check if option "-all" is used
# "-all" option: extract all atomsets
# default: extract first atomset only
first_only = True
# check if option "-first" is used
# "-first" option: extract first atomset only
# default: extract all atomsets
first_only = False
input_source = sys.argv[1]
if ( sys.argv[1] == "-all" ):
if ( sys.argv[1] == "-first" ):
if ( argc != 3 ):
usage()
first_only = False
first_only = True
input_source = sys.argv[2]
# conversion from Bohr to Angstrom
......
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