1 #ifndef AFQMC_READWFN_H
2 #define AFQMC_READWFN_H
3 
4 #include <cstdlib>
5 #include <iostream>
6 #include <fstream>
7 #include <vector>
8 #include <string>
9 #include <ctype.h>
10 
11 #include "Utilities/SimpleParser.h"
12 
13 #include "hdf/hdf_archive.h"
14 #include "AFQMC/config.h"
15 #include "AFQMC/Matrix/csr_matrix.hpp"
16 #include "AFQMC/Matrix/csr_matrix_construct.hpp"
17 #include "AFQMC/Wavefunctions/Excitations.hpp"
18 
19 namespace qmcplusplus
20 {
21 namespace afqmc
22 {
23 /*
24  * Reads ndets from the ascii file.
25  */
26 void read_general_wavefunction(std::ifstream& in,
27                                int& ndets,
28                                WALKER_TYPES walker_type,
29                                boost::mpi3::shared_communicator& comm,
30                                int NMO,
31                                int NAEA,
32                                int NAEB,
33                                std::vector<PsiT_Matrix>& PsiT,
34                                std::vector<ComplexType>& ci);
35 
36 ph_excitations<int, ComplexType> read_ph_wavefunction(std::ifstream& in,
37                                                       int& ndets,
38                                                       WALKER_TYPES walker_type,
39                                                       boost::mpi3::shared_communicator& comm,
40                                                       int NMO,
41                                                       int NAEA,
42                                                       int NAEB,
43                                                       std::vector<PsiT_Matrix>& PsiT);
44 
45 void read_ph_wavefunction_hdf(hdf_archive& dump,
46                               std::vector<ComplexType>& ci_coeff,
47                               std::vector<int>& occs,
48                               int& ndets,
49                               WALKER_TYPES walker_type,
50                               boost::mpi3::shared_communicator& comm,
51                               int NMO,
52                               int NAEA,
53                               int NAEB,
54                               std::vector<PsiT_Matrix>& PsiT,
55                               std::string& type);
56 
57 ph_excitations<int, ComplexType> build_ph_struct(std::vector<ComplexType> ci_coeff,
58                                                  boost::multi::array_ref<int, 2>& occs,
59                                                  int ndets,
60                                                  boost::mpi3::shared_communicator& comm,
61                                                  int NMO,
62                                                  int NAEA,
63                                                  int NAEB);
64 
65 void getCommonInput(hdf_archive& dump,
66                     int NMO,
67                     int NAEA,
68                     int NAEB,
69                     int& ndets_to_read,
70                     std::vector<ComplexType>& ci,
71                     WALKER_TYPES& walker_type,
72                     bool root);
73 
74 WALKER_TYPES getWalkerType(std::string filename);
75 WALKER_TYPES getWalkerTypeHDF5(std::string filename, std::string type);
76 
77 std::string getWfnType(std::ifstream& in);
78 
79 // modify for multideterminant case based on type
80 int readWfn(std::string fileName,
81             boost::multi::array<ComplexType, 3>& OrbMat,
82             int NMO,
83             int NAEA,
84             int NAEB,
85             int det = 0);
86 
87 } // namespace afqmc
88 
89 } // namespace qmcplusplus
90 
91 #endif
92