50 if (!hin.
open(fname.c_str(), H5F_ACC_RDONLY))
52 std::cerr <<
"Could not open H5 file" << std::endl;
56 hin.
push(
"application");
59 std::cout <<
"Converting Wavefunction from the " <<
CodeName <<
" Code" << std::endl;
65 std::cout <<
"Periodic Boundary Conditions: " << (
PBC ? (
"yes") : (
"no")) << std::endl;
69 hin.
push(
"parameters");
71 std::cout <<
"usingECP: " << (
ECP ? (
"yes") : (
"no")) << std::endl;
74 std::cout <<
"Multideterminants: " << (
multideterminant ? (
"yes") : (
"no")) << std::endl;
82 std::cout <<
"NUMBER OF AOs: " <<
numAO << std::endl;
85 std::cout <<
"NUMBER OF MOs: " <<
numMO << std::endl;
89 std::cout <<
"Unit in Bohr=" <<
bohr << std::endl;
102 std::cout <<
"Number of alpha electrons: " <<
NumberOfAlpha << std::endl;
103 std::cout <<
"Number of beta electrons: " <<
NumberOfBeta << std::endl;
104 std::cout <<
"Number of electrons: " <<
NumberOfEls << std::endl;
110 std::cout <<
"NUMBER OF ATOMS: " <<
NumberOfAtoms << std::endl;
117 hin.
push(
"Super_Twist");
121 for (
int i = 0; i <
numMO; i++)
127 hin.
read(myvec,
"eigenval_1");
128 for (
int i = 0; i <
numMO; i++)
134 app_warning() <<
"eigenval_0 doesn't exist in h5 file. Treat all values zero." << std::endl;
159 std::cerr <<
"Could not open H5 file" << std::endl;
163 hin.
push(
"MultiDet");
182 std::cout <<
" Done reading CIs!!" << std::endl;
195 if (!hin.
open(fname.c_str(), H5F_ACC_RDONLY))
197 std::cerr <<
"Could not open H5 file" << std::endl;
202 hin.
read(LatticeVec,
"LatticeVectors");
203 X[0] = LatticeVec[0][0];
204 X[1] = LatticeVec[0][1];
205 X[2] = LatticeVec[0][2];
206 Y[0] = LatticeVec[1][0];
207 Y[1] = LatticeVec[1][1];
208 Y[2] = LatticeVec[1][2];
209 Z[0] = LatticeVec[2][0];
210 Z[1] = LatticeVec[2][1];
211 Z[2] = LatticeVec[2][2];
213 std::cout <<
"Lattice parameters in Bohr:" << std::endl;
214 std::cout <<
X[0] <<
" " <<
X[1] <<
" " <<
X[2] << std::endl;
215 std::cout <<
Y[0] <<
" " <<
Y[1] <<
" " <<
Y[2] << std::endl;
216 std::cout <<
Z[0] <<
" " <<
Z[1] <<
" " <<
Z[2] << std::endl;
222 if (!hin.
open(fname.c_str(), H5F_ACC_RDONLY))
224 std::cerr <<
"Could not open H5 file" << std::endl;
230 std::vector<int> atomic_number;
231 std::vector<double> q, pos;
236 std::map<int, int> AtomIndexmap;
237 hin.
read(idx,
"species_ids");
240 AtomIndexmap.insert(std::pair<int, int>(i, idx[i]));
244 std::string speciesName(
"species_");
245 speciesName = speciesName + std::to_string(AtomIndexmap[i]);
246 hin.
push(speciesName);
250 hin.
read(zint,
"atomic_number");
251 atomic_number.push_back(zint);
252 hin.
read(z,
"charge");
254 hin.
read(Name,
"name");
255 tags.push_back(Name);
260 hin.
read(IonPos,
"positions");
269 int speciesID = species.addSpecies(
GroupName[i]);
282 if (!hin.
open(fname.c_str(), H5F_ACC_RDONLY))
284 std::cerr <<
"Could not open H5 file" << std::endl;
288 hin.
push(
"Super_Twist");
292 hin.
read(MyVec,
"Coord");
312 if (!hin.
open(fname.c_str(), H5F_ACC_RDONLY))
314 std::cerr <<
"Could not open H5 file" << std::endl;
318 std::string setname =
"/Super_Twist/eigenset_0";
319 hin.
read(CartMat, setname);
320 setname =
"/Super_Twist/eigenval_0";
326 setname =
"/Super_Twist/eigenset_1";
327 hin.
read(CartMat, setname);
328 setname =
"/Super_Twist/eigenval_1";
335 int n = btot / 4, b = 0;
336 int dn = btot -
n * 4;
337 std::ostringstream eig;
339 eig.setf(std::ios::scientific, std::ios::floatfield);
340 eig.setf(std::ios::right, std::ios::adjustfield);
343 for (
int k = 0; k <
n; k++)
345 eig << std::setw(22) <<
EigVec[b] << std::setw(22) <<
EigVec[b + 1] << std::setw(22) <<
EigVec[b + 2]
346 << std::setw(22) <<
EigVec[b + 3] <<
"\n";
349 for (
int k = 0; k < dn; k++)
351 eig << std::setw(22) <<
EigVec[b++];
353 std::cout << eig.str() << std::endl;
354 std::cout <<
"Finished reading MO." << std::endl;
Container_t::iterator begin()
std::vector< value_type > EigVal_beta
std::ostream & app_warning()
bool open(const std::filesystem::path &fname, unsigned flags=H5F_ACC_RDWR)
open a file
void getSuperTwist(const std::string &fname)
void close()
close all the open groups and file
std::vector< double > CIcoeff
std::vector< std::string > tags
std::vector< std::string > GroupName
ParticleIndex GroupID
Species ID.
void copy(const Array< T1, 3 > &src, Array< T2, 3 > &dest)
std::vector< value_type > EigVal_alpha
std::vector< double > STwist_Coord
std::vector< value_type > EigVec
static std::map< int, std::string > IonName
void getMO(const std::string &fname)
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
std::vector< std::string > CIalpha
void create(const std::vector< int > &agroup)
create grouped particles
void parse(const std::string &fname) override
void push(const std::string &gname, bool createit=true)
push a group to the group stack
void getCell(const std::string &fname)
void read(T &data, const std::string &aname)
read the data from the group aname and check status runtime error is issued on I/O error ...
void getGaussianCenters(const std::string fname)
Custom container for set of attributes for a set of species.
void getGeometry(const std::string &fname)
bool readEntry(T &data, const std::string &aname)
read the data from the group aname and return status use read() for inbuilt error checking ...
std::vector< std::string > CIbeta
Container_t::iterator end()