|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
Internal helpers shared by the R-space sparse text writers. Declared here (instead of duplicated in each anonymous namespace) so the header layout, R records and file-append rules cannot diverge between hs_sparse_io.cpp, dhs_sparse_writer.cpp, pos_op_csr.cpp, hsr_writer.cpp and write_dmr.cpp. More...
Namespaces | |
| namespace | detail |
Classes | |
| class | csrFileReader |
| Class to read CSR file. More... | |
| class | FileReader |
| A base class of file reader. More... | |
| class | SparseMatrix |
| Sparse matrix class designed mainly for csr format input and output. More... | |
| class | CifParser |
| class | UcellIO |
| A class for unit cell I/O operations. More... | |
| struct | ParameterMetadata |
| Metadata for a single INPUT parameter. More... | |
| class | ParameterHelp |
| Help system for ABACUS INPUT parameters. More... | |
| class | Get_pchg_pw |
| Write band-resolved PW partial charges on the dense real-space grid. More... | |
| struct | WriteDHParams |
| class | Cal_ldos |
| struct | EijOutputInfo |
| Eij output settings and one-based identifiers for one electronic state. More... | |
| class | Angmom_op |
| struct | SparseWriteOptions |
| struct | MatROutputOptions |
| struct | HTermSpec |
| struct | WriteHParams |
| struct | MatSparseOutputOptions |
| class | Cal_MLKEDF_Descriptors |
| A class to calculate the descriptors for ML KEDF. Sun, Liang, and Mohan Chen. Physical Review B 109.11 (2024): 115135. Sun, Liang, and Mohan Chen. Electronic Structure 6.4 (2024): 045006. More... | |
| class | Write_MLKEDF_Descriptors |
| class | Output_DMK |
| class | Output_Sk |
| class | Output_Mulliken |
| the output interface to write the Mulliken population charges More... | |
| struct | AvailabilityCondition |
| struct | AvailabilityExpr |
| struct | InputValue |
| struct | InputRequirement |
| class | InputDomain |
| class | Input_Item |
| class | ReadInput |
| class | Get_wf_pw |
| Write real-space norms and complex components of selected PW states. More... | |
| struct | CommandLineArgs |
| class | OutputMullikenNspin4Test |
Typedefs | |
| using | DosSpectrum = std::vector<std::array<double, 5>> |
| using | RCoordinate = Abfs::Vector3_Order<int> |
| template<typename T> | |
| using | SparseRBlock = std::map<size_t, std::map<size_t, T>> |
| template<typename T> | |
| using | SparseRMatrix = std::map<RCoordinate, SparseRBlock<T>> |
| using | InputValues = std::map<std::string, InputValue> |
| using | TC = std::array<int, 3> |
| using | TAC = std::pair<int, TC> |
Enumerations | |
| enum class | AvailabilityValueKind { Unknown , Boolean , Integer , Real , String , BooleanVector , IntegerVector , RealVector , StringVector } |
Functions | |
| std::string | filename_output (const std::string &directory, const std::string &property, const std::string &basis, const int ik_local, const std::vector< int > &ik2iktot, const int nspin, const int nkstot, const int out_type, const int out_app_flag, const bool gamma_only, const int istep, const int iter) |
| void | read_abacus_orb (std::ifstream &ifs, std::string &elem, double &ecut, int &nr, double &dr, std::vector< int > &nzeta, std::vector< std::vector< double > > &radials, const int rank=0) |
| static version of read_abacus_orb. A delete-new operation may cause the memory leak, it is better to use std::vector to replace the raw pointer. | |
| void | write_abacus_orb (std::ofstream &ofs, const std::string &elem, const double &ecut, const int nr, const double dr, const std::vector< int > &nzeta, const std::vector< std::vector< double > > &radials, const int rank=0) |
| int | read_exit_file (const int &my_rank, const std::string &filename, std::ofstream &ofs_running) |
| read file to determine whether to stop the current execution | |
| void | write_csr_banner (std::ostream &ofs) |
| Write the CSR-format description banner used by every text CSR output (H(R)/S(R), DM(R), dH/dR, r(R), T(R), Vxc(R), L(R)). | |
| void | write_elecstat_pot (const int &bz, const int &nbz, const std::string &fn, const int &istep, ModulePW::PW_Basis *rho_basis, const Charge *const chr, const UnitCell *ucell_, const double *v_eff_fixed, const surchem &solvent, const std::vector< double > *pcc_potential, const std::vector< double > *solvent_potential, const int precision, const bool append, std::ofstream &ofs_running) |
| write electric static potential to file | |
| std::string | gen_ini_filename (const std::string &prefix, const std::string &out_dir, const int nspin, const int is, const int istep, const bool include_geom_step) |
| void | write_chg_init (const UnitCell &ucell, const Parallel_Grid ¶_grid, const Charge &chr, const elecstate::Efermi &efermi, const int istep, const std::string &out_dir, const Input_para &inp, const bool two_fermi, std::ofstream &ofs_running) |
| void | write_pot_init (const UnitCell &ucell, const Parallel_Grid ¶_grid, elecstate::ElecState *pelec, const int istep, const std::string &out_dir, const Input_para &inp, const bool two_fermi, std::ofstream &ofs_running) |
| std::vector< std::string > | libxc_r_channel_suffixes (const std::string &data_name, int nspin) |
| Build the channel suffixes appended to the cube file names of one Libxc quantity. | |
| template<typename TK, typename TR> | |
| void | ctrl_iter_lcao (UnitCell &ucell, const Input_para &inp, K_Vectors &kv, elecstate::ElecState *pelec, module_dm::DensityMatrix< TK, double > &dm, Parallel_Orbitals &pv, Grid_Driver &gd, psi::Psi< TK > *psi, Charge &chr, Charge_Mixing *p_chgmix, hamilt::HamiltLCAO< TK, TR > *p_hamilt, LCAO_Orbitals &orb, Setup_DeePKS< TK > &deepks, Exx_NAO< TK > &exx_nao, const Exx_Info &exx_info, int &iter, const int istep, bool &conv_esolver, const double &scf_ene_thr) |
| template void | ctrl_iter_lcao< double, double > (UnitCell &ucell, const Input_para &inp, K_Vectors &kv, elecstate::ElecState *pelec, module_dm::DensityMatrix< double, double > &dm, Parallel_Orbitals &pv, Grid_Driver &gd, psi::Psi< double > *psi, Charge &chr, Charge_Mixing *p_chgmix, hamilt::HamiltLCAO< double, double > *p_hamilt, LCAO_Orbitals &orb, Setup_DeePKS< double > &deepks, Exx_NAO< double > &exx_nao, const Exx_Info &exx_info, int &iter, const int istep, bool &conv_esolver, const double &scf_ene_thr) |
| template void | ctrl_iter_lcao< std::complex< double >, double > (UnitCell &ucell, const Input_para &inp, K_Vectors &kv, elecstate::ElecState *pelec, module_dm::DensityMatrix< std::complex< double >, double > &dm, Parallel_Orbitals &pv, Grid_Driver &gd, psi::Psi< std::complex< double > > *psi, Charge &chr, Charge_Mixing *p_chgmix, hamilt::HamiltLCAO< std::complex< double >, double > *p_hamilt, LCAO_Orbitals &orb, Setup_DeePKS< std::complex< double > > &deepks, Exx_NAO< std::complex< double > > &exx_nao, const Exx_Info &exx_info, int &iter, const int istep, bool &conv_esolver, const double &scf_ene_thr) |
| void | ctrl_output_fp (UnitCell &ucell, const Input_para &inp, elecstate::ElecState *pelec, ModulePW::PW_Basis_Big *pw_big, ModulePW::PW_Basis *pw_rhod, Charge &chr, surchem &solvent, Parallel_Grid ¶_grid, const int istep, std::ofstream &ofs_running) |
| void | ctrl_iter_pw (const int istep, const int iter, const double &conv_esolver, Setup_Psi_pw &stp, const K_Vectors &kv, const ModulePW::PW_Basis_K *pw_wfc, const Input_para &inp, bool final_output, std::ofstream &ofs_running) |
| template<typename T, typename Device> | |
| void | ctrl_scf_pw (const int istep, UnitCell &ucell, elecstate::ElecState *pelec, const Charge &chr, const pseudopot_cell_vnl &ppcell, const K_Vectors &kv, const ModulePW::PW_Basis_K *pw_wfc, const ModulePW::PW_Basis *pw_rho, const ModulePW::PW_Basis *pw_rhod, const ModulePW::PW_Basis_Big *pw_big, Setup_Psi_pw &stp, const Parallel_Grid ¶_grid, const Input_para &inp, std::ofstream &ofs_running) |
| template<typename T, typename Device> | |
| void | ctrl_runner_pw (UnitCell &ucell, elecstate::ElecState *pelec, ModulePW::PW_Basis_K *pw_wfc, ModulePW::PW_Basis *pw_rho, ModulePW::PW_Basis *pw_rhod, Charge &chr, K_Vectors &kv, Setup_Psi_pw &stp, Structure_Factor &sf, pseudopot_cell_vnl &ppcell, surchem &solvent, Parallel_Grid ¶_grid, const int istep, const Input_para &inp, std::ofstream &ofs_running) |
| template<typename T, typename Device> | |
| void | ctrl_runner_pw (UnitCell &ucell, elecstate::ElecState *pelec, ModulePW::PW_Basis_K *pw_wfc, ModulePW::PW_Basis *pw_rho, ModulePW::PW_Basis *pw_rhod, Charge &chr, K_Vectors &kv, Setup_Psi_pw &stp, Structure_Factor &sf, pseudopot_cell_vnl &ppcell, surchem &solvent, const base_device::DeviceContext *ctx, Parallel_Grid ¶_grid, const Input_para &inp, std::ofstream &ofs_running) |
| template<typename TR> | |
| void | ctrl_output_td (const UnitCell &ucell, double **rho_save, const ModulePW::PW_Basis *rhopw, const int istep, const psi::Psi< std::complex< double > > *psi, const elecstate::ElecState *pelec, const K_Vectors &kv, const TwoCenterIntegrator *intor, const Parallel_Orbitals *pv, const LCAO_Orbitals &orb, const Velocity_op< TR > *velocity_mat, const Grid_Driver &grid, hamilt::HamiltLCAO< std::complex< double >, TR > *p_hamilt, Record_adj &RA, TD_info *td_p, const Exx_NAO< std::complex< double > > &exx_nao, const Exx_Info &exx_info) |
| template void | ctrl_output_td< double > (const UnitCell &, double **, const ModulePW::PW_Basis *, const int, const psi::Psi< std::complex< double > > *, const elecstate::ElecState *, const K_Vectors &, const TwoCenterIntegrator *, const Parallel_Orbitals *, const LCAO_Orbitals &, const Velocity_op< double > *, const Grid_Driver &, hamilt::HamiltLCAO< std::complex< double >, double > *, Record_adj &, TD_info *, const Exx_NAO< std::complex< double > > &, const Exx_Info &) |
| template void | ctrl_output_td< std::complex< double > > (const UnitCell &, double **, const ModulePW::PW_Basis *, const int, const psi::Psi< std::complex< double > > *, const elecstate::ElecState *, const K_Vectors &, const TwoCenterIntegrator *, const Parallel_Orbitals *, const LCAO_Orbitals &, const Velocity_op< std::complex< double > > *, const Grid_Driver &, hamilt::HamiltLCAO< std::complex< double >, std::complex< double > > *, Record_adj &, TD_info *, const Exx_NAO< std::complex< double > > &, const Exx_Info &) |
| void | ctrl_output_td_pw (const pw::TDVelResultPW ¤ts, const pw::TDSpinResultPW &moments, const pw::CurrentRequest &request, const std::string &mag_partition, const std::string &orbital_dir, double onsite_radius, bool calc_torque, const std::vector< std::string > &orbital_fn, int step, double dt_ha, int nspin, int nkstot, int rank, const std::string &directory, std::ostream &log) |
| Write precomputed endpoint observables on the designated output rank. | |
| template<typename TK, typename TR> | |
| void | ctrl_runner_lcao (UnitCell &ucell, const Input_para &inp, const int istep, K_Vectors &kv, elecstate::ElecState *pelec, const module_dm::Setup_DM< TK > &dmat, Parallel_Orbitals &pv, Parallel_Grid &pgrid, Grid_Driver &gd, psi::Psi< TK > *psi, Charge &chr, hamilt::HamiltLCAO< TK, TR > *p_hamilt, TwoCenterBundle &two_center_bundle, LCAO_Orbitals &orb, ModulePW::PW_Basis *pw_rho, ModulePW::PW_Basis *pw_rhod, Structure_Factor &sf, ModuleBase::matrix &vloc, Exx_NAO< TK > &exx_nao, const Exx_Info &exx_info, surchem &solvent, std::ofstream &ofs_running) |
| template void | ctrl_runner_lcao< double, double > (UnitCell &ucell, const Input_para &inp, const int istep, K_Vectors &kv, elecstate::ElecState *pelec, const module_dm::Setup_DM< double > &dmat, Parallel_Orbitals &pv, Parallel_Grid &pgrid, Grid_Driver &gd, psi::Psi< double > *psi, Charge &chr, hamilt::HamiltLCAO< double, double > *p_hamilt, TwoCenterBundle &two_center_bundle, LCAO_Orbitals &orb, ModulePW::PW_Basis *pw_rho, ModulePW::PW_Basis *pw_rhod, Structure_Factor &sf, ModuleBase::matrix &vloc, Exx_NAO< double > &exx_nao, const Exx_Info &exx_info, surchem &solvent, std::ofstream &ofs_running) |
| template void | ctrl_runner_lcao< std::complex< double >, double > (UnitCell &ucell, const Input_para &inp, const int istep, K_Vectors &kv, elecstate::ElecState *pelec, const module_dm::Setup_DM< std::complex< double > > &dmat, Parallel_Orbitals &pv, Parallel_Grid &pgrid, Grid_Driver &gd, psi::Psi< std::complex< double > > *psi, Charge &chr, hamilt::HamiltLCAO< std::complex< double >, double > *p_hamilt, TwoCenterBundle &two_center_bundle, LCAO_Orbitals &orb, ModulePW::PW_Basis *pw_rho, ModulePW::PW_Basis *pw_rhod, Structure_Factor &sf, ModuleBase::matrix &vloc, Exx_NAO< std::complex< double > > &exx_nao, const Exx_Info &exx_info, surchem &solvent, std::ofstream &ofs_running) |
| template<typename TK, typename TR> | |
| void | ctrl_scf_lcao (UnitCell &ucell, const Input_para &inp, K_Vectors &kv, elecstate::ElecState *pelec, module_dm::DensityMatrix< TK, double > *dm, Parallel_Orbitals &pv, Grid_Driver &gd, psi::Psi< TK > *psi, hamilt::HamiltLCAO< TK, TR > *p_hamilt, Plus_U_Base &dftu, TwoCenterBundle &two_center_bundle, LCAO_Orbitals &orb, const ModulePW::PW_Basis_K *pw_wfc, const ModulePW::PW_Basis *pw_rho, const ModulePW::PW_Basis_Big *pw_big, Structure_Factor &sf, const ModulePW::PW_Basis *pw_rhod, const ModuleBase::matrix &vloc, surchem &solvent, rdmft::RDMFT< TK, TR > &rdmft_solver, Setup_DeePKS< TK > &deepks, Exx_NAO< TK > &exx_nao, const Exx_Info &exx_info, const bool conv_esolver, const bool scf_nmax_flag, const bool last_ion_step, const int istep, std::ofstream &ofs_running) |
| void | write_current_pw (const pw::TDVelResultPW ¤t, int istep, int nk_per_spin, bool out_current_k, const std::string &out_dir) |
| Write reduced charge currents on the output rank; performs no collectives. | |
| void | write_td_spin_pw (const std::string &directory, int step, double time_fs, const std::vector< std::string > &orbitals, const std::string &mag_partition, const std::string &orbital_dir, double onsite_radius, bool calc_torque, bool spin_current, const pw::TDSpinResultPW &spin, const pw::TDVelResultPW ¤t, std::ostream &log) |
| Write globally reduced endpoint data on the designated output rank only. | |
| void | write_dh_perI (WriteDHParams ¶ms, int ispin, const std::string &rprefix, const std::string &kprefix, const std::string &label, const std::string &term_name, std::array< std::vector< hamilt::HContainer< double > * >, 3 > &g, const std::vector< int > &atom_filter) |
| void | write_dH_components (WriteDHParams ¶ms, const Exx_Info &exx_info) |
| std::vector< int > | dh_atom_filter (const std::vector< int > ¶m) |
| bool | write_dH_t (WriteDHParams ¶ms) |
| bool | write_dH_vnl (WriteDHParams ¶ms) |
| bool | write_dH_vl (WriteDHParams ¶ms) |
| bool | write_dH_vh (WriteDHParams ¶ms) |
| bool | write_dH_vh_pulay (WriteDHParams ¶ms) |
| bool | write_dH_vxc (WriteDHParams ¶ms) |
| bool | write_dH_vxc_pulay (WriteDHParams ¶ms) |
| bool | write_dH_sum (WriteDHParams ¶ms) |
| void | write_dipole (const UnitCell &ucell, const double *rho, const ModulePW::PW_Basis *rhopw, const int &istep, const std::string &fn, std::ofstream &ofs_running, const int &precision=13) |
| Write aligned electronic dipoles; precision counts significant digits. | |
| void | print_dipole_moment (std::ofstream &ofs_running, const std::string &name, double px, double py, double pz) |
| std::string | dmk_gen_fname (const bool gamma_only, const int ispin, const int nspin, const int ik, const int istep) |
| Generates the filename for the DMK file based on the given parameters. | |
| bool | dmk_readData (std::ifstream &ifs, double &data) |
| Read one double from a file. | |
| bool | dmk_readData (std::ifstream &ifs, std::complex< double > &data) |
| Read one complex double from a file. | |
| template<typename T> | |
| bool | read_dmk (const int nspin, const int nk, const K_Vectors &kv, const Parallel_Blkcyclic &pv, const bool column_major, const std::string &dmk_dir, const int istep, const int out_app_flag, std::vector< std::vector< T > > &dmk, std::ofstream &ofs_running) |
| Reads the DMK data from a file. | |
| template<typename T> | |
| void | write_dmk (const std::vector< std::vector< T > > &dmk, const K_Vectors &kv, const int precision, const std::vector< double > &efs, const UnitCell *ucell, const Parallel_Blkcyclic &pv, const bool column_major, const std::string &dmk_dir, const int istep, const int out_app_flag, std::ofstream &ofs_running) |
| Writes the DMK data to a file. | |
| std::string | dmr_gen_fname (const int out_type, const int ispin, const bool numbered, const int istep) |
| void | write_dmr_csr (std::string &fname, const UnitCell *ucell, const int precision, hamilt::HContainer< double > *dm_serial, const int istep, const int ispin, const int nspin, const bool append) |
| void | write_dmr (const std::vector< hamilt::HContainer< double > * > dmr, const UnitCell *ucell, const int precision, const Parallel_Blkcyclic ¶V, const int out_app_flag, const int *iat2iwt, const int nat, const std::string &dmr_dir, const int istep, std::ofstream &ofs_running) |
| void | prepare_dos (std::ofstream &ofs_running, const elecstate::Efermi &energy_fermi, const ModuleBase::matrix &ekb, const int nks, const int nbands, const double &dos_edelta_ev, const double &dos_scale, double &emax, double &emin, const bool dos_setemax, const double dos_emax_ev, const bool dos_setemin, const double dos_emin_ev, const bool two_fermi) |
| bool | cal_dos (const int &is, const std::string &fn, const double &de_ev, const double &emax_ev, const double &emin_ev, const double &bcoeff, const int &nks, const int &nkstot, const std::vector< double > &wk, const std::vector< int > &isk, const int &nbands, const ModuleBase::matrix &ekb, const ModuleBase::matrix &wg, const int istep_in, const int out_app_flag, const int precision, const int bndpar, DosSpectrum *spectrum) |
| template<typename Device> | |
| void | cal_ldos_pw (const elecstate::ElecStatePW< std::complex< double > > *pelec, const psi::Psi< std::complex< double >, Device > &psi, const Device *ctx, const Parallel_Grid &pgrid, const UnitCell &ucell, const std::vector< int > &out_ldos, const std::vector< double > &stm_bias, const int nspin, const int istep, const std::string &global_out_dir, const bool two_fermi, const int nbands, const double dos_edelta_ev, const double dos_scale, const bool dos_setemax, const double dos_emax_ev, const bool dos_setemin, const double dos_emin_ev, const double dos_sigma, const std::vector< double > &ldos_line, std::ofstream &ofs_running) |
| template<typename Device> | |
| void | stm_mode_pw (const elecstate::ElecStatePW< std::complex< double > > *pelec, const psi::Psi< std::complex< double >, Device > &psi, const Device *ctx, const Parallel_Grid &pgrid, const UnitCell &ucell, const std::vector< double > &stm_bias, const int nspin, const int istep, const std::string &global_out_dir, const bool two_fermi, const int out_ldos_precision, std::ofstream &ofs_running) |
| template<typename Device> | |
| void | ldos_mode_pw (const elecstate::ElecStatePW< std::complex< double > > *pelec, const psi::Psi< std::complex< double >, Device > &psi, const Device *ctx, const Parallel_Grid &pgrid, const UnitCell &ucell, const int istep, const std::string &global_out_dir, const int nbands, const double dos_edelta_ev, const double dos_scale, const bool dos_setemax, const double dos_emax_ev, const bool dos_setemin, const double dos_emin_ev, const bool two_fermi, const double dos_sigma, const std::vector< double > &ldos_line, std::ofstream &ofs_running) |
| void | get_grid_points (const std::vector< double > &start, const std::vector< double > &end, const int &npoints, const int &nx, const int &ny, const int &nz, std::vector< std::vector< int > > &points, std::vector< std::vector< double > > &shifts) |
| void | trilinear_interpolate (const std::vector< std::vector< int > > &points, const std::vector< std::vector< double > > &shifts, const Parallel_Grid &pgrid, const std::vector< double > &data, std::vector< double > &results) |
| template void | cal_ldos_pw< base_device::DEVICE_CPU > (const elecstate::ElecStatePW< std::complex< double > > *pelec, const psi::Psi< std::complex< double >, base_device::DEVICE_CPU > &psi, const base_device::DEVICE_CPU *ctx, const Parallel_Grid &pgrid, const UnitCell &ucell, const std::vector< int > &out_ldos, const std::vector< double > &stm_bias, const int nspin, const int istep, const std::string &global_out_dir, const bool two_fermi, const int nbands, const double dos_edelta_ev, const double dos_scale, const bool dos_setemax, const double dos_emax_ev, const bool dos_setemin, const double dos_emin_ev, const double dos_sigma, const std::vector< double > &ldos_line, std::ofstream &ofs_running) |
| std::vector< ModuleBase::matrix > | cal_pdos (const psi::Psi< double > *psi, hamilt::Hamilt< double > *p_ham, const Parallel_Orbitals &pv, const K_Vectors &kv, const int nspin0, const int nbands, const ModuleBase::matrix &ekb, const double &emax, const double &emin, const double &dos_edelta_ev, const double &bcoeff, const int nlocal, const int nspin) |
| std::vector< ModuleBase::matrix > | cal_pdos (const psi::Psi< std::complex< double > > *psi, hamilt::Hamilt< std::complex< double > > *p_ham, const Parallel_Orbitals &pv, const K_Vectors &kv, const int nspin0, const int nbands, const ModuleBase::matrix &ekb, const double &emax, const double &emin, const double &dos_edelta_ev, const double &bcoeff, const int nlocal, const int nspin) |
| void | write_dos_npy_header (std::ostream &out, const std::string &fields, std::size_t count) |
| Write the NPY v1 header for a one-dimensional array of structured records. | |
| template<typename T> | |
| void | write_dos_lcao (const psi::Psi< T > *psi, hamilt::Hamilt< T > *p_ham, const Parallel_Orbitals &pv, const UnitCell &ucell, const K_Vectors &kv, const int nbands, const elecstate::Efermi &energy_fermi, const ModuleBase::matrix &ekb, const ModuleBase::matrix &wg, const double &dos_edelta_ev, const double &dos_scale, const double &bcoeff, const int out_dos, const int out_app_flag, const int precision, const int istep, const int nspin, const int nlocal, const bool dos_setemax, const double dos_emax_ev, const bool dos_setemin, const double dos_emin_ev, const bool two_fermi, const int bndpar, const std::string &global_out_dir, std::ofstream &ofs_running) |
| calculate density of states(DOS), partial density of states(PDOS), and mulliken charge for LCAO base | |
| template void | write_dos_lcao (const psi::Psi< double > *psi, hamilt::Hamilt< double > *p_ham, const Parallel_Orbitals &pv, const UnitCell &ucell, const K_Vectors &kv, const int nbands, const elecstate::Efermi &energy_fermi, const ModuleBase::matrix &ekb, const ModuleBase::matrix &wg, const double &dos_edelta_ev, const double &dos_scale, const double &bcoeff, const int out_dos, const int out_app_flag, const int precision, const int istep, const int nspin, const int nlocal, const bool dos_setemax, const double dos_emax_ev, const bool dos_setemin, const double dos_emin_ev, const bool two_fermi, const int bndpar, const std::string &global_out_dir, std::ofstream &ofs_running) |
| template void | write_dos_lcao (const psi::Psi< std::complex< double > > *psi, hamilt::Hamilt< std::complex< double > > *p_ham, const Parallel_Orbitals &pv, const UnitCell &ucell, const K_Vectors &kv, const int nbands, const elecstate::Efermi &energy_fermi, const ModuleBase::matrix &ekb, const ModuleBase::matrix &wg, const double &dos_edelta_ev, const double &dos_scale, const double &bcoeff, const int out_dos, const int out_app_flag, const int precision, const int istep, const int nspin, const int nlocal, const bool dos_setemax, const double dos_emax_ev, const bool dos_setemin, const double dos_emin_ev, const bool two_fermi, const int bndpar, const std::string &global_out_dir, std::ofstream &ofs_running) |
| void | write_dos_pw (const UnitCell &ucell, const ModuleBase::matrix &ekb, const ModuleBase::matrix &wg, const K_Vectors &kv, const int nbands, const int istep_in, const elecstate::Efermi &energy_fermi, const double &dos_edelta_ev, const double &dos_scale, const double &bcoeff, const int nspin, const int out_dos, const bool dos_setemax, const double dos_emax_ev, const bool dos_setemin, const double dos_emin_ev, const bool two_fermi, const int out_app_flag, const int precision, const int bndpar, const std::string &global_out_dir, std::ofstream &ofs_running) |
| calculate density of states(DOS) for PW base | |
| void | write_pdos_text (const UnitCell &ucell, const ModuleBase::matrix *pdos, const int nspin, const int nlocal, const int npoints, const double &emin, const double &dos_edelta_ev, const std::string &out_dir, const int istep, const int out_app_flag, const int precision, std::ofstream &ofs_running) |
| void | write_pdos_npy (const UnitCell &cell, const std::vector< ModuleBase::matrix > &pdos, int nspin, double emin, double de, const std::string &path) |
| Write one NPY array of atom- and orbital-projected spin spectra. | |
| void | prep_td_field_out (const std::string &output_dir, std::size_t field_count, bool restart) |
| Prepare electric-field output files for an RT-TDDFT calculation. | |
| void | prep_td_field_out (const std::string &output_dir, const elecstate::TDFieldManager &manager, bool restart) |
| Prepare total endpoint E and, for analytic fields, the configured waveform files. | |
| void | write_td_field (const elecstate::TDFieldManager &manager, const std::string &output_dir) |
| Append the current electric-field samples to their output files. Times are written in fs with six decimal places, starting at physical time zero. Field components use scientific notation with twelve decimal places; columns are right-aligned. | |
| std::vector< ModuleBase::Vector3< double > > | read_td_vecpot (const std::string &input_dir) |
| Read Cartesian vector potentials for an RT-TDDFT calculation. | |
| void | check_td_vecpot_paths (const std::string &input_dir, const std::string &output_dir) |
| Reject output that aliases the input file, including symbolic and hard links. | |
| void | prep_td_vecpot_out (const std::string &output_dir, bool restart) |
| Prepare the vector-potential output file for an RT-TDDFT calculation. | |
| void | write_td_vecpot (const std::string &output_dir, int electronic_step, const ModuleBase::Vector3< double > &vector_pot) |
| Append one Cartesian vector-potential sample. | |
| void | write_elf (const std::string &out_dir, const int &istep_in, const int &nspin, const double *const *rho, const double *const *tau, ModulePW::PW_Basis *const rho_basis, const Parallel_Grid &pgrid, const UnitCell *ucell_, const int &precision, const std::string &geom_block, const bool two_fermi, const bool append, std::ofstream &ofs_running) |
| void | print_eij (const std::complex< double > *eij, const int nband, const int leading_dimension, const EijOutputInfo &output_info, std::ostream &ofs) |
| Print selected elements of a column-major Hamiltonian in the orbital basis, in Ry. | |
| template<typename T, typename Device> | |
| void | print_eij_pw (hsolver::HSOperator< T, Device > &op, hsolver::TDOrbOps< T, Device > &orbitals, psi::Psi< T, Device > ¤t, const K_Vectors &kv, int nspin, int step, int iter, double threshold, std::ostream &log) |
| Collect and print Eij from an already bound endpoint Hamiltonian. All ranks participate; both k-point cursors are restored before returning. | |
| template void | print_eij_pw (hsolver::HSOperator< std::complex< float >, base_device::DEVICE_CPU > &, hsolver::TDOrbOps< std::complex< float >, base_device::DEVICE_CPU > &, psi::Psi< std::complex< float >, base_device::DEVICE_CPU > &, const K_Vectors &, int, int, int, double, std::ostream &) |
| template void | print_eij_pw (hsolver::HSOperator< std::complex< double >, base_device::DEVICE_CPU > &, hsolver::TDOrbOps< std::complex< double >, base_device::DEVICE_CPU > &, psi::Psi< std::complex< double >, base_device::DEVICE_CPU > &, const K_Vectors &, int, int, int, double, std::ostream &) |
| void | write_bands (const Input_para &inp, const ModuleBase::matrix &ekb, const K_Vectors &kv, std::ofstream &ofs_running, const std::string &band_dir, const int istep) |
| write the eigenvalues of every spin channel to band.txt (nspin=1/4) or to bands1.txt/bands2.txt (nspin=2). | |
| void | nscf_bands (const int &is, const std::string &eig_file, const int &nband, const double &fermie, const int &precision, const ModuleBase::matrix &ekb, const K_Vectors &kv, const std::string &header, const int out_app_flag) |
| calculate the band structure | |
| template<typename TK, typename TR> | |
| void | write_eband_terms (const int nspin, const int istep, const int out_app_flag, const double etot, const int my_rank, const int nbasis, const Parallel_Orbitals *pv, const psi::Psi< TK > &psi, const UnitCell &ucell, Structure_Factor &sf, surchem &solvent, const ModulePW::PW_Basis &rho_basis, const ModulePW::PW_Basis &rhod_basis, const ModuleBase::matrix &vloc, const Charge &chg, const K_Vectors &kv, const ModuleBase::matrix &wg, Grid_Driver &gd, const std::vector< double > &orb_cutoff, const LCAO_Orbitals &orb, const TwoCenterBundle &two_center_bundle, std::ofstream &ofs_running) |
| Write the band-decomposed energy of each Hamiltonian term (kinetic, local/nonlocal pp, Hartree) in KS orbital representation. The XC term is handled by write_Vxc from ctrl_scf_lcao.cpp instead. | |
| template void | write_eband_terms< double, double > (const int, const int, const int, const double, const int, const int, const Parallel_Orbitals *, const psi::Psi< double > &, const UnitCell &, Structure_Factor &, surchem &, const ModulePW::PW_Basis &, const ModulePW::PW_Basis &, const ModuleBase::matrix &, const Charge &, const K_Vectors &, const ModuleBase::matrix &, Grid_Driver &, const std::vector< double > &, const LCAO_Orbitals &, const TwoCenterBundle &, std::ofstream &) |
| template void | write_eband_terms< std::complex< double >, double > (const int, const int, const int, const double, const int, const int, const Parallel_Orbitals *, const psi::Psi< std::complex< double > > &, const UnitCell &, Structure_Factor &, surchem &, const ModulePW::PW_Basis &, const ModulePW::PW_Basis &, const ModuleBase::matrix &, const Charge &, const K_Vectors &, const ModuleBase::matrix &, Grid_Driver &, const std::vector< double > &, const LCAO_Orbitals &, const TwoCenterBundle &, std::ofstream &) |
| void | write_eig_iter (const ModuleBase::matrix &ekb, const ModuleBase::matrix &wg, const K_Vectors &kv, const int nbands, const int nspin) |
| print eigenvalues and occupations to the running log | |
| void | write_eig_file (const ModuleBase::matrix &ekb, const ModuleBase::matrix &wg, const K_Vectors &kv, const int nbands, const int nspin, const std::string &out_dir, const int istep, const int out_app_flag) |
| write eigenvalues and occupations to <out_dir>/eig_occ.txt | |
| template<typename TK> | |
| void | write_proj_band_lcao (const psi::Psi< TK > *psi, const Parallel_Orbitals &pv, const elecstate::ElecState *pelec, const K_Vectors &kv, const UnitCell &ucell, hamilt::Hamilt< TK > *p_ham, const int istep, const int out_app_flag) |
| std::complex< double > | cal_LzijR (const std::unique_ptr< TwoCenterIntegrator > &calculator, const int it, const int ia, const int il, const int iz, const int mi, const int jt, const int ja, const int jl, const int jz, const int mj, const ModuleBase::Vector3< double > &vR) |
| calculate the <phi_i|Lz|phi_j> matrix elements, in which the Lz are the angular momentum operators, |phi_i> and |phi_j> are the numerical atomic orbitals (NAOs). | |
| std::complex< double > | cal_LyijR (const std::unique_ptr< TwoCenterIntegrator > &calculator, const int it, const int ia, const int il, const int iz, const int im, const int jt, const int ja, const int jl, const int jz, const int jm, const ModuleBase::Vector3< double > &vR) |
| calculate the <phi_i|Ly|phi_j> matrix elements, in which the Lz are the angular momentum operators, |phi_i> and |phi_j> are the numerical atomic orbitals (NAOs). | |
| std::complex< double > | cal_LxijR (const std::unique_ptr< TwoCenterIntegrator > &calculator, const int it, const int ia, const int il, const int iz, const int im, const int jt, const int ja, const int jl, const int jz, const int jm, const ModuleBase::Vector3< double > &vR) |
| calculate the <phi_i|Lx|phi_j> matrix elements, in which the Lz are the angular momentum operators, |phi_i> and |phi_j> are the numerical atomic orbitals (NAOs). | |
| std::size_t | dense_buffer_index (const int i, const int j, const int nlocal, const bool column_major) |
| Flat index of matrix element (i, j) in a gathered buffer. | |
| void | write_dense_text_body (std::ofstream &ofs, const std::vector< double > &mat, const int nlocal, const int precision, const bool column_major) |
| Write a dense square matrix body in the flat NAO text layout shared by the DM(k), H(k)/S(k) and T(k) writers. | |
| void | write_dense_text_body (std::ofstream &ofs, const std::vector< std::complex< double > > &mat, const int nlocal, const int precision, const bool column_major) |
| Complex overload of write_dense_text_body. | |
| void | save_dH_sparse (const int &istep, const Parallel_Orbitals &pv, const UnitCell *ucell, LCAO_HS_Arrays &HS_Arrays, const double &sparse_thr, const bool &binary, const std::string &fileflag, const int precision, const std::string &global_matrix_dir, const std::string &calculation, const int out_app_flag, const int nspin, const int nlocal, std::ofstream &ofs_running) |
| template<typename T> | |
| void | save_mat (const int istep, const T *mat, const int dim, const bool bit, const int precision, const bool tri, const bool app, const std::string &file_name, const Parallel_Blkcyclic &pv, const int drank, const std::string &ks_solver, const bool reduce=true) |
| save a square matrix, such as H(k) and S(k) | |
| template<typename Tdata> | |
| void | save_sparse (const SparseRMatrix< Tdata > &smat, const std::set< RCoordinate > &all_R_coor, const Parallel_Orbitals &pv, const SparseWriteOptions &options) |
| template<typename T> | |
| void | write_hsk (const std::string &global_out_dir, const int nspin, const int nks, const int nkstot, const std::vector< int > &ik2iktot, const std::vector< int > &isk, hamilt::Hamilt< T > *p_hamilt, const Parallel_Orbitals &pv, const K_Vectors &kv, const UnitCell *ucell, const std::vector< double > &efs, const bool gamma_only, const int out_app_flag, const int istep, const int out_type, const int precision, const int nlocal, const std::string &ks_solver, const int drank, std::ofstream &ofs_running) |
| Write H(k) and S(k) matrices for each k-point to disk. | |
| void | output_dHR (const int &istep, const ModuleBase::matrix &v_eff, const UnitCell &ucell, const Parallel_Orbitals &pv, LCAO_HS_Arrays &HS_Arrays, const Grid_Driver &grid, const TwoCenterBundle &two_center_bundle, const LCAO_Orbitals &orb, const MatROutputOptions &options, const bool gamma_only_local, const int npol, const int nlocal, std::ofstream &ofs_running) |
| void | output_dSR (const int &istep, const UnitCell &ucell, const Parallel_Orbitals &pv, LCAO_HS_Arrays &HS_Arrays, const Grid_Driver &grid, const TwoCenterBundle &two_center_bundle, const LCAO_Orbitals &orb, const MatROutputOptions &options, const bool gamma_only_local, const int npol, const int nlocal, std::ofstream &ofs_running) |
| void | output_TR (const int istep, const UnitCell &ucell, const Parallel_Orbitals &pv, LCAO_HS_Arrays &HS_Arrays, const Grid_Driver &grid, const TwoCenterBundle &two_center_bundle, const LCAO_Orbitals &orb, const std::string &TR_filename, const MatROutputOptions &options, std::ofstream &ofs_running) |
| template<typename TK> | |
| void | output_SR (const UnitCell &ucell, Parallel_Orbitals &pv, const Grid_Driver &grid, hamilt::Hamilt< TK > *p_ham, const bool &binary, const double &sparse_threshold, const int precision, const std::string &global_matrix_dir, const std::string &calculation, const int out_app_flag, const int nspin, const int istep, std::ofstream &ofs_running) |
| std::string | hsr_gen_fname (const std::string &prefix, const int ispin, const bool numbered, const int istep) |
| std::string | hsr_gen_fname (const std::string &prefix, const int ispin, const bool numbered, const int istep, const int out_type) |
| Generate filename for spin-dependent HR output in the selected format. | |
| std::string | sr_gen_fname (const bool numbered, const int istep) |
| Generate filename for spin-independent SR output. | |
| std::string | sr_gen_fname (const bool numbered, const int istep, const int out_type) |
| Generate filename for spin-independent SR output in the selected format. | |
| std::string | dhr_gen_fname (const std::string &prefix, const int ispin, const bool numbered, const int istep) |
| Generate filename for derivative matrices (dH/dR, dS/dR). | |
| std::string | dhk_gen_fname (const std::string &prefix, const int ispin, const int nspin, const bool numbered, const int istep) |
| template<typename TR> | |
| bool | write_hcontainer_csr (const std::string &fname, const UnitCell *ucell, const int precision, hamilt::HContainer< TR > *mat_serial, const int istep, const bool append, const int ispin, const int nspin, const std::string &label, const std::string &representation_note, const double efermi_eV, const bool has_efermi) |
| template<typename TR> | |
| void | write_hcontainer_csr_binary (const std::string &fname, hamilt::HContainer< TR > *mat_serial, const int istep, const bool append) |
| Write one HContainer record in the native binary CSR format. | |
| template<typename TR> | |
| void | write_hsr (const std::vector< hamilt::HContainer< TR > * > &hr_vec, const hamilt::HContainer< TR > *sr, const UnitCell *ucell, const int out_type, const int precision, const Parallel_Blkcyclic ¶V, const int out_app_flag, const bool gamma_only, const int *iat2iwt, const int nat, const int istep, const std::string &global_out_dir, const elecstate::Efermi &eferm, std::ofstream &ofs_running) |
| void | write_h_vnl (WriteHParams ¶ms) |
| void | write_h_vl (WriteHParams ¶ms) |
| void | write_h_vh (WriteHParams ¶ms) |
| void | write_h_vxc (WriteHParams ¶ms) |
| template<typename T> | |
| void | save_lat_r (std::ofstream &ofs, const SparseRBlock< T > &XR, const Parallel_Blkcyclic &layout, const SparseWriteOptions &options) |
| template<typename T> | |
| void | save_lat_r_csr (std::ofstream &ofs, const SparseRBlock< T > &XR, const Parallel_Blkcyclic &layout, const SparseWriteOptions &options) |
| Write one R block in the H(R)/S(R)/r(R) CSR text layout. | |
| template<typename T> | |
| void | save_lat_r_empty_csr (std::ofstream &ofs, int nlocal, const SparseWriteOptions &options) |
| Write an all-zero R block in the H(R)/S(R)/r(R) CSR text layout. | |
| template<typename T> | |
| void | output_mat_sparse (const MatSparseOutputOptions &options, const int &istep, const ModuleBase::matrix &v_eff, const Parallel_Orbitals &pv, const TwoCenterBundle &two_center_bundle, const LCAO_Orbitals &orb, UnitCell &ucell, const Grid_Driver &grid, const K_Vectors &kv, hamilt::Hamilt< T > *p_ham, Plus_U_Base *p_dftu, const std::string &global_out_dir, const std::string &global_matrix_dir, const std::string &calculation, const int out_app_flag, const int nspin, const bool gamma_only_local, const int npol, const int nlocal, const bool cal_force, std::ofstream &ofs_running) |
| the output interface to write the sparse matrix of dH, dS, T, and r | |
| template void | output_mat_sparse< double > (const MatSparseOutputOptions &options, const int &istep, const ModuleBase::matrix &v_eff, const Parallel_Orbitals &pv, const TwoCenterBundle &two_center_bundle, const LCAO_Orbitals &orb, UnitCell &ucell, const Grid_Driver &grid, const K_Vectors &kv, hamilt::Hamilt< double > *p_ham, Plus_U_Base *p_dftu, const std::string &global_out_dir, const std::string &global_matrix_dir, const std::string &calculation, const int out_app_flag, const int nspin, const bool gamma_only_local, const int npol, const int nlocal, const bool cal_force, std::ofstream &ofs_running) |
| template void | output_mat_sparse< std::complex< double > > (const MatSparseOutputOptions &options, const int &istep, const ModuleBase::matrix &v_eff, const Parallel_Orbitals &pv, const TwoCenterBundle &two_center_bundle, const LCAO_Orbitals &orb, UnitCell &ucell, const Grid_Driver &grid, const K_Vectors &kv, hamilt::Hamilt< std::complex< double > > *p_ham, Plus_U_Base *p_dftu, const std::string &global_out_dir, const std::string &global_matrix_dir, const std::string &calculation, const int out_app_flag, const int nspin, const bool gamma_only_local, const int npol, const int nlocal, const bool cal_force, std::ofstream &ofs_running) |
| template<typename FPTYPE> | |
| void | write_Vxc_LIP (int nspin, const int istep, const double etot, int naos, int drank, const psi::Psi< std::complex< FPTYPE > > &psi_pw, const UnitCell &ucell, Structure_Factor &sf, surchem &solvent, const ModulePW::PW_Basis_K &wfc_basis, const ModulePW::PW_Basis &rho_basis, const ModulePW::PW_Basis &rhod_basis, const ModuleBase::matrix &vloc, const Charge &chg, const K_Vectors &kv, const ModuleBase::matrix &wg, const bool gamma_only, const std::string &global_out_dir, const int out_ndigits, const std::string &ks_solver, bool cal_exx, double hybrid_alpha) |
| Write the Vxc matrix in KS orbital representation for LIP (LCAO-in-PW), useful for GW calculation including terms: local/semi-local XC and EXX. The band-decomposed diagonal energies (eband_vxc.txt and, with EXX, eband_vxc_local.txt and eband_vxc_exx.txt) are written to global_out_dir. | |
| template void | write_Vxc_LIP< float > (int, const int, const double, int, int, const psi::Psi< std::complex< float > > &, const UnitCell &, Structure_Factor &, surchem &, const ModulePW::PW_Basis_K &, const ModulePW::PW_Basis &, const ModulePW::PW_Basis &, const ModuleBase::matrix &, const Charge &, const K_Vectors &, const ModuleBase::matrix &, const bool, const std::string &, const int, const std::string &, bool, double) |
| template void | write_Vxc_LIP< double > (int, const int, const double, int, int, const psi::Psi< std::complex< double > > &, const UnitCell &, Structure_Factor &, surchem &, const ModulePW::PW_Basis_K &, const ModulePW::PW_Basis &, const ModulePW::PW_Basis &, const ModuleBase::matrix &, const Charge &, const K_Vectors &, const ModuleBase::matrix &, const bool, const std::string &, const int, const std::string &, bool, double) |
| template<typename TK, typename TR> | |
| void | write_Vxc (const int nspin, const int istep, const double etot, const int nbasis, const int drank, const Parallel_Orbitals *pv, const psi::Psi< TK > &psi, const UnitCell &ucell, Structure_Factor &sf, surchem &solvent, const ModulePW::PW_Basis &rho_basis, const ModulePW::PW_Basis &rhod_basis, const ModuleBase::matrix &vloc, const Charge &chg, const K_Vectors &kv, const std::vector< double > &orb_cutoff, const ModuleBase::matrix &wg, Grid_Driver &gd, const bool dft_plus_u, const bool gamma_only, const bool out_mat, const int out_app_flag, const std::string &mat_dir, const std::string &global_out_dir, const int out_ndigits, const std::string &ks_solver, bool cal_exx, const Exx_Info &exx_info, std::ofstream &ofs_running) |
| Write the Vxc matrix in KS orbital representation, useful for GW calculation including terms: local/semi-local XC, EXX, DFTU. The band-decomposed diagonal energies (eband_vxc.txt and, with EXX, eband_vxc_local.txt and eband_vxc_exx.txt) are always written to global_out_dir; the full MO-basis matrices (vxcmok*_nao.txt) are written to mat_dir only when out_mat is true. The MO-basis name keeps the "vxcmo" property so that it never collides with the NAO-basis "vxck*_nao.txt" produced by out_mat_vxck. | |
| template void | write_Vxc< double, double > (const int, const int, const double, const int, const int, const Parallel_Orbitals *, const psi::Psi< double > &, const UnitCell &, Structure_Factor &, surchem &, const ModulePW::PW_Basis &, const ModulePW::PW_Basis &, const ModuleBase::matrix &, const Charge &, const K_Vectors &, const std::vector< double > &, const ModuleBase::matrix &, Grid_Driver &, const bool, const bool, const bool, const int, const std::string &, const std::string &, const int, const std::string &, bool, const Exx_Info &, std::ofstream &) |
| template void | write_Vxc< std::complex< double >, double > (const int, const int, const double, const int, const int, const Parallel_Orbitals *, const psi::Psi< std::complex< double > > &, const UnitCell &, Structure_Factor &, surchem &, const ModulePW::PW_Basis &, const ModulePW::PW_Basis &, const ModuleBase::matrix &, const Charge &, const K_Vectors &, const std::vector< double > &, const ModuleBase::matrix &, Grid_Driver &, const bool, const bool, const bool, const int, const std::string &, const std::string &, const int, const std::string &, bool, const Exx_Info &, std::ofstream &) |
| template<typename T> | |
| std::map< Abfs::Vector3_Order< int >, std::map< size_t, std::map< size_t, T > > > | cal_HR_sparse (const hamilt::HContainer< T > &hR, const double sparse_thr) |
| Helper to calculate sparse HR representation. | |
| template<typename TK, typename TR> | |
| void | write_Vxc_R (const int nspin, const Parallel_Orbitals *pv, const UnitCell &ucell, Structure_Factor &sf, surchem &solvent, const ModulePW::PW_Basis &rho_basis, const ModulePW::PW_Basis &rhod_basis, const ModuleBase::matrix &vloc, const Charge &chg, const K_Vectors &kv, const std::vector< double > &orb_cutoff, Grid_Driver &gd, const std::string &global_out_dir, bool cal_exx, double hybrid_alpha, bool real_number, const int istep, const double sparse_thr, const int precision, std::ofstream &ofs_running) |
| Write the Vxc matrix in real space (R), useful for GW calculation including terms: local/semi-local XC, EXX, DFTU The files are named vxcrs{spin}_nao.csr as a final-step snapshot; the spin index is one-based. | |
| template void | write_Vxc_R< double, double > (const int, const Parallel_Orbitals *, const UnitCell &, Structure_Factor &, surchem &, const ModulePW::PW_Basis &, const ModulePW::PW_Basis &, const ModuleBase::matrix &, const Charge &, const K_Vectors &, const std::vector< double > &, Grid_Driver &, const std::string &, bool, double, bool, const int, const double, const int, std::ofstream &) |
| template void | write_Vxc_R< std::complex< double >, double > (const int, const Parallel_Orbitals *, const UnitCell &, Structure_Factor &, surchem &, const ModulePW::PW_Basis &, const ModulePW::PW_Basis &, const ModuleBase::matrix &, const Charge &, const K_Vectors &, const std::vector< double > &, Grid_Driver &, const std::string &, bool, double, bool, const int, const double, const int, std::ofstream &) |
| void | set_para2d_MO (const Parallel_Orbitals &pv, const int nbands, Parallel_Blkcyclic &p2d) |
| Set up a 2D parallel distribution for MO-space matrices (nbands x nbands). | |
| template<typename T> | |
| std::vector< T > | cVc (const T *V, const T *c, const int nbasis, const int nbands, const Parallel_Orbitals &pv, const Parallel_Blkcyclic &p2d) |
| Compute c^dagger * V * c in MO basis. | |
| template<typename T> | |
| double | all_band_energy (const int ik, const std::vector< T > &mat_mo, const Parallel_Blkcyclic &p2d, const ModuleBase::matrix &wg) |
| Sum over bands with occupation weights. | |
| template<typename T> | |
| std::vector< double > | orbital_energy (const int ik, const int nbands, const std::vector< T > &mat_mo, const Parallel_Blkcyclic &p2d) |
| Extract diagonal elements (orbital energies) from MO matrix. | |
| void | write_orb_energy (const K_Vectors &kv, const int nspin0, const int nbands, const std::vector< std::vector< double > > &e_orb, const std::string &out_name, const std::string &header, const std::string &global_out_dir, const bool app=false) |
| Write orbital energies to file in LibRPA format. | |
| std::string | eband_filename (const std::string &stem, const int istep, const int out_app_flag) |
| Compose the name of a band-decomposed energy file. | |
| std::string | build_eband_header (const int istep, const double etot_eV, const std::string &term_symbol, const std::string &time_stamp) |
| Build the five comment lines preceding band-decomposed energy data. | |
| template std::vector< double > | cVc< double > (const double *, const double *, const int, const int, const Parallel_Orbitals &, const Parallel_Blkcyclic &) |
| template std::vector< std::complex< double > > | cVc< std::complex< double > > (const std::complex< double > *, const std::complex< double > *, const int, const int, const Parallel_Orbitals &, const Parallel_Blkcyclic &) |
| template double | all_band_energy< double > (const int, const std::vector< double > &, const Parallel_Blkcyclic &, const ModuleBase::matrix &) |
| template double | all_band_energy< std::complex< double > > (const int, const std::vector< std::complex< double > > &, const Parallel_Blkcyclic &, const ModuleBase::matrix &) |
| template std::vector< double > | orbital_energy< double > (const int, const int, const std::vector< double > &, const Parallel_Blkcyclic &) |
| template std::vector< double > | orbital_energy< std::complex< double > > (const int, const int, const std::vector< std::complex< double > > &, const Parallel_Blkcyclic &) |
| double | get_real (const std::complex< double > &c) |
| Extract real part (for complex numbers). | |
| double | get_real (const double &d) |
| Extract real part (for real numbers, identity). | |
| void | read_mat_npz (const Parallel_Orbitals *paraV, const UnitCell &ucell, std::string &zipname, hamilt::HContainer< double > &hR) |
| template<typename T> | |
| void | output_mat_npz_impl (const UnitCell &ucell, std::string &zipname, const hamilt::HContainer< T > &hR) |
| void | output_mat_npz (const UnitCell &ucell, std::string &zipname, const hamilt::HContainer< double > &hR) |
| void | output_mat_npz (const UnitCell &ucell, std::string &zipname, const hamilt::HContainer< std::complex< double > > &hR) |
| template<typename TK> | |
| void | cal_mag (Parallel_Orbitals *pv, hamilt::Hamilt< TK > *p_ham, K_Vectors &kv, module_dm::DensityMatrix< TK, double > *dm, const TwoCenterBundle &two_center_bundle, const LCAO_Orbitals &orb, UnitCell &ucell, const Grid_Driver &gd, const int istep, const int out_app_flag, const bool print) |
| void | collect_MW_nspin4 (ModuleBase::matrix &MecMulP, const ModuleBase::ComplexMatrix &mud, int nw, const Parallel_Orbitals *pv) |
| Accumulate the nspin=4 Mulliken charge and Mx/My/Mz components. | |
| std::string | make_data_desc (const std::string &base, const std::string &mag_base, const int is, const int nspin) |
| bool | read_vdata_palgrid (const Parallel_Grid &pgrid, const int my_rank, std::ostream &ofs_running, const std::string &fn, double *const data, const int nat) |
| read volumetric data from .cube file into the parallel distributed grid. | |
| void | write_vdata_palgrid (const Parallel_Grid &pgrid, const double *const data, const int is, const int nspin, const int iter, const std::string &fn, const double ef, const UnitCell *const ucell, const int precision, const int out_fermi, const bool two_fermi, const bool reduce_all_pool, const bool append, std::ofstream &ofs_running, const std::string &data_desc) |
| bool | read_cube (const std::string &file, std::vector< std::string > &comment, int &natom, std::vector< double > &origin, int &nx, int &ny, int &nz, std::vector< double > &dx, std::vector< double > &dy, std::vector< double > &dz, std::vector< int > &atom_type, std::vector< double > &atom_charge, std::vector< std::vector< double > > &atom_pos, std::vector< double > &data) |
| read the full data from a cube file | |
| void | write_cube (const std::string &file, const std::vector< std::string > &comment, const int &natom, const std::vector< double > &origin, const int &nx, const int &ny, const int &nz, const std::vector< double > &dx, const std::vector< double > &dy, const std::vector< double > &dz, const std::vector< int > &atom_type, const std::vector< double > &atom_charge, const std::vector< std::vector< double > > &atom_pos, const std::vector< double > &data, const int precision, const bool append, const int ndata_line=6) |
| void | write_cube_header (std::ofstream &ofs, const std::vector< std::string > &comment, const int &natom, const std::vector< double > &origin, const int &nx, const int &ny, const int &nz, const std::vector< double > &dx, const std::vector< double > &dy, const std::vector< double > &dz, const std::vector< int > &atom_type, const std::vector< double > &atom_charge, const std::vector< std::vector< double > > &atom_pos, const int precision) |
| void | write_cube_header_for_cell (std::ofstream &ofs, const UnitCell &ucell, const int nx, const int ny, const int nz, const std::vector< std::string > &comment, const int precision) |
| void | trilinear_interpolate (const double *const data_in, const int &nx_read, const int &ny_read, const int &nz_read, const int &nx, const int &ny, const int &nz, double *data_out) |
| The trilinear interpolation method. | |
| bool | frame_appends (const int out_app_flag, const int istep) |
| Tell whether an output written for ionic step istep should append. | |
| std::string | stru_frame_filename (const std::string &directory, const int out_app_flag, const int istep) |
| Fixed STRU for overwrite/append modes; numbered STRU for mode 2. | |
| void | output_convergence_after_scf (const bool &convergence, double &energy, std::ofstream &ofs_running) |
| output if is convergence and energy after scf | |
| void | output_after_relax (bool conv_ion, bool conv_esolver, std::ofstream &ofs_running) |
| output after relaxation | |
| void | output_efermi (const bool &convergence, const elecstate::Efermi &eferm, std::ofstream &ofs_running) |
| output the fermi energy | |
| void | output_vacuum_level (const UnitCell *ucell, const double *const *rho, const double *v_elecstat, const int &nx, const int &ny, const int &nz, const int &nxyz, const int &nrxx, const int &nplane, const int &startz_current, std::ofstream &ofs_running) |
| calculate and output the vacuum level We first determine the vacuum direction, then get the vacuum position based on the minimum of charge density, finally output the vacuum level, i.e., the electrostatic potential at the vacuum position. | |
| void | print_force (std::ofstream &ofs, const UnitCell &cell, const std::string &name, const ModuleBase::matrix &force, bool ry=true) |
| output atomic forces | |
| void | print_net_force (std::ofstream &ofs, const ModuleBase::Vector3< double > &net_force) |
| output the net force vector and the magnitude of the force drift | |
| void | print_stress (const std::string &name, const ModuleBase::matrix &scs, const bool screen, const bool ry, std::ofstream &ofs) |
| output stress components | |
| void | write_head (std::ofstream &ofs_running, const int &istep, const int &iter, const std::string &basisname) |
| write head for scf iteration | |
| void | write_head_td (std::ofstream &ofs_running, const int &istep, const int &estep, const int &iter, const std::string &basisname) |
| write head for scf iteration | |
| void | print_parameters (const UnitCell &ucell, K_Vectors &kv, const Input_para &inp) |
| void | print_time (time_t &time_start, time_t &time_finish) |
| void | print_rhofft (ModulePW::PW_Basis *pw_rhod, ModulePW::PW_Basis *pw_rho, ModulePW::PW_Basis_Big *pw_big, std::ofstream &ofs) |
| Print charge density using FFT. | |
| void | print_wfcfft (const Input_para &inp, ModulePW::PW_Basis_K &pw_wfc, std::ofstream &ofs) |
| void | print_screen (const int &stress_step, const int &force_step, const int &istep) |
| void | print_kpar (const int &nks, const int &kpar_lcao) |
| std::string | local_timestamp () |
| std::string | provenance_header (const std::string &time_stamp) |
| std::string | prov_step (const int istep_one_based, const std::string &time_stamp) |
| Two provenance lines followed by the unified "# Ionic_Step N" marker. | |
| std::string | prov_inline (const std::string &time_stamp) |
| std::string | make_spin_tag (const int is, const int nspin) |
| std::string | make_compact_spin_tag (const int is, const int nspin) |
| void | print_conserv (const pw::TDConserv &values, double npsi0, double nrho0, int step, bool full_gram, const std::string &orth, std::ofstream &log) |
| Print endpoint conservation relative to the caller's initial counts. | |
| void | write_notice (std::ofstream &ofs_running, const std::string &property, const std::string &file_name) |
| Announce a written output file in the running log. | |
| void | write_notice (std::ofstream &ofs_running, const std::string &property, const int is, const int nspin, const std::string &file_name) |
| Announce a spin-resolved output file in the running log. | |
| void | write_matrix_notice (std::ofstream &ofs_running, const std::string &property, const std::string &file_name) |
| Announce a written NAO-basis matrix file in the running log. | |
| void | write_matrix_notice (std::ofstream &ofs_running, const std::string &property, const int is, const int nspin, const std::string &file_name) |
| Announce a written spin-resolved NAO-basis matrix file in the log. | |
| void | write_orb_info (const UnitCell *ucell, std::ofstream &ofs_running) |
| void | print_PAOs (const UnitCell &ucell) |
| print chi (PAO) in pseudopotential file | |
| AvailabilityExpr | parse_availability (const std::string &raw) |
| AvailabilityValueKind | availability_value_kind (const std::string &type) |
| void | validate_availability_expr (const std::string &owner, const AvailabilityExpr &expression, const std::map< std::string, AvailabilityValueKind > ¶meter_types) |
| void | validate_availability_self_contained (const std::string &owner, const AvailabilityExpr &expression, const std::map< std::string, AvailabilityExpr > &expressions) |
| bool | evaluate_input_condition (const AvailabilityExpr &expression, const InputValues &values) |
| std::string | input_manual_link (const std::string &label) |
| std::string | input_diagnostic (const std::string &label, const std::string &value, const std::string &origin, const std::string &expected) |
| bool | parse_imp_sol (const std::string &value, int &model, std::string &error) |
| bool | check_sccs_inp (const Input_para &input, std::string &error) |
| bool | parse_spreads (const std::vector< std::string > &words, std::vector< double > &spreads, std::string &error) |
| void | check_td_efield_parameters (const Input_para &input) |
| Validate the structure and waveform-defining constraints of RT-TDDFT fields. | |
| std::string | longstring (const std::vector< std::string > &words) |
| bool | assume_as_boolean (const std::string &val) |
| std::string | to_dir (const std::string &str) |
| void | read_information (std::stringstream &ifs, std::vector< std::string > &output, const std::string &delimiters) |
| bool | filter_nonascii_and_comment (std::ifstream &ifs, std::stringstream &out_ascii_stream) |
| std::string | nofound_str (std::vector< std::string > init_chgs, const std::string &str) |
| bool | dsp_layout_check_needed (const std::string &esolver_type) |
| Whether the DSP kpar/bndpar layout constraint applies. | |
| int | dsp_effective_kpar (const std::string &basis_type, const int kpar, const int kpar_lcao) |
| The k-point pool count actually consumed by the current basis. | |
| bool | dsp_kpar_layout_valid (const int nproc, const std::string &basis_type, const int kpar, const int kpar_lcao, const int bndpar, const std::string &esolver_type) |
| Check whether a k-point/band parallel layout satisfies the DSP vendor library constraint. | |
| TEST (AvailabilityParser, LeafEqualityRoundTrip) | |
| TEST (AvailabilityParser, SlashRemainsPartOfSingleEqualityValue) | |
| TEST (AvailabilityParser, InListRoundTrip) | |
| TEST (AvailabilityParser, VectorContainmentSemantics) | |
| TEST (AvailabilityParser, QuotedMultiTokenValueRoundTrip) | |
| TEST (AvailabilityParser, AndGroup) | |
| TEST (AvailabilityParser, ParenthesisedOrNesting) | |
| TEST (AvailabilityParser, EmptyIsAlwaysAvailable) | |
| TEST (AvailabilityParser, InvalidExpressionsAreRejected) | |
| TEST (AvailabilityParser, NonCanonicalSpellingIsRejected) | |
| TEST (AvailabilityParser, SetterPreservesStateOnParseFailure) | |
| TEST (AvailabilityValidator, AcceptsKnownTypedReferences) | |
| TEST (AvailabilityValidator, InfersDocumentedTypes) | |
| TEST (AvailabilityValidator, RejectsUnknownAndIncompatibleReferences) | |
| TEST (AvailabilityValidator, AcceptsDependenciesOfDependencies) | |
| TEST (AvailabilityValidator, RejectsMissingTransitiveRequirement) | |
| TEST (AvailabilityValidator, AcceptsOrPrerequisiteImpliedByPath) | |
| TEST (AvailabilityValidator, RequiresExactNonEqualityPrerequisite) | |
| TEST (AvailabilityValidator, ChecksPrerequisitesTransitivelyThroughOr) | |
| TEST (AvailabilityValidator, RejectsSelfReference) | |
| template<typename Tdata> | |
| void | read_Hexxs_csr (const std::string &file_name, const UnitCell &ucell, const int nspin, const int nbasis, std::vector< std::map< int, std::map< TAC, RI::Tensor< Tdata > > > > &Hexxs) |
| read Hexxs in CSR format | |
| template<typename Tdata> | |
| void | read_Hexxs_cereal (const std::string &file_name, std::vector< std::map< int, std::map< TAC, RI::Tensor< Tdata > > > > &Hexxs) |
| read Hexxs in cereal format | |
| template<typename Tdata> | |
| std::map< Abfs::Vector3_Order< int >, std::map< size_t, std::map< size_t, Tdata > > > | calculate_RI_Tensor_sparse (const double &sparse_threshold, const std::map< int, std::map< TAC, RI::Tensor< Tdata > > > &Hexxs, const UnitCell &ucell) |
| template<typename Tdata> | |
| void | write_Hexxs_csr (const std::string &file_name, const UnitCell &ucell, const std::vector< std::map< int, std::map< TAC, RI::Tensor< Tdata > > > > &Hexxs) |
| write Hexxs in CSR format | |
| template void | read_Hexxs_csr< double > (const std::string &, const UnitCell &, const int, const int, std::vector< std::map< int, std::map< TAC, RI::Tensor< double > > > > &) |
| template void | read_Hexxs_csr< std::complex< double > > (const std::string &, const UnitCell &, const int, const int, std::vector< std::map< int, std::map< TAC, RI::Tensor< std::complex< double > > > > > &) |
| template void | read_Hexxs_cereal< double > (const std::string &, std::vector< std::map< int, std::map< TAC, RI::Tensor< double > > > > &) |
| template void | read_Hexxs_cereal< std::complex< double > > (const std::string &, std::vector< std::map< int, std::map< TAC, RI::Tensor< std::complex< double > > > > > &) |
| template std::map< Abfs::Vector3_Order< int >, std::map< size_t, std::map< size_t, double > > > | calculate_RI_Tensor_sparse< double > (const double &, const std::map< int, std::map< TAC, RI::Tensor< double > > > &, const UnitCell &) |
| template std::map< Abfs::Vector3_Order< int >, std::map< size_t, std::map< size_t, std::complex< double > > > > | calculate_RI_Tensor_sparse< std::complex< double > > (const double &, const std::map< int, std::map< TAC, RI::Tensor< std::complex< double > > > > &, const UnitCell &) |
| template void | write_Hexxs_csr< double > (const std::string &, const UnitCell &, const std::vector< std::map< int, std::map< TAC, RI::Tensor< double > > > > &) |
| template void | write_Hexxs_csr< std::complex< double > > (const std::string &, const UnitCell &, const std::vector< std::map< int, std::map< TAC, RI::Tensor< std::complex< double > > > > > &) |
| void | read_wf2rho_pw (const ModulePW::PW_Basis_K *pw_wfc, ModuleSymmetry::Symmetry &symm, Charge &chg, const std::string &readin_dir, const int kpar, const int my_pool, const int my_rank, const int nproc_in_pool, const int rank_in_pool, const int nbands, const int nspin, const int npol, const int nkstot, const std::vector< int > &ik2iktot, const std::vector< int > &isk, std::ofstream &ofs_running) |
| read wave functions and occupation numbers to charge density | |
| template<typename Device> | |
| void | read_wf2rho_pw_impl (const ModulePW::PW_Basis_K *pw_wfc, ModuleSymmetry::Symmetry &symm, Charge &chg, const std::string &readin_dir, const int kpar, const int my_pool, const int my_rank, const int nproc_in_pool, const int rank_in_pool, const int nbands, const int nspin, const int npol, const int nkstot, const std::vector< int > &ik2iktot, const std::vector< int > &isk, std::ofstream &ofs_running) |
| bool | read_wfc_nao_spin_populations (const std::string &readin_dir, int nkstot, int nspin, bool gamma_only, bool binary, int my_rank, std::vector< double > &populations) |
| void | read_wfc_nao_one_data (std::ifstream &ifs, float &data) |
| Reads a single data value from an input file stream. | |
| void | read_wfc_nao_one_data (std::ifstream &ifs, double &data) |
| void | read_wfc_nao_one_data (std::ifstream &ifs, std::complex< float > &data) |
| Reads a single complex data value from an input file stream. | |
| void | read_wfc_nao_one_data (std::ifstream &ifs, std::complex< double > &data) |
| template<typename T> | |
| bool | read_wfc_nao (const std::string &global_readin_dir, const Parallel_Orbitals &ParaV, psi::Psi< T > &psid, ModuleBase::matrix &ekb, ModuleBase::matrix &wg, const std::vector< int > &ik2iktot, const int nkstot, const int nspin, const bool binary, const int skip_band=0, const int istep=-1) |
| Reads the wavefunction coefficients from an input file. | |
| void | read_wfc_pw (const std::string &filedir, const ModulePW::PW_Basis_K *pw_wfc, const int rank_in_pool, const int nproc_in_pool, const int nbands, const int npol, const int &ik, const int &ikstot, const int &nkstot, ModuleBase::ComplexMatrix &wfc) |
| read wave functions from binary file | |
| void | wfc_nao_write2file (const std::string &name, const double *ctot, const int nlocal, const int ik, const ModuleBase::matrix &ekb, const ModuleBase::matrix &wg, const bool &writeBinary, const bool &append_flag, const std::string &header) |
| write real-valued Gamma-only wavefunction coefficients to a file. | |
| void | wfc_nao_write2file_complex (const std::string &name, const std::complex< double > *ctot, const int nlocal, const int &ik, const ModuleBase::Vector3< double > &kvec_c, const ModuleBase::matrix &ekb, const ModuleBase::matrix &wg, const bool &writeBinary, const bool &append_flag, const std::string &header) |
| write complex wavefunction coefficients to a file. | |
| template<typename T> | |
| void | write_wfc_nao (const int out_type, const int out_app_flag, const psi::Psi< T > &psi, const ModuleBase::matrix &ekb, const ModuleBase::matrix &wg, const std::vector< ModuleBase::Vector3< double > > &kvec_c, const std::vector< int > &ik2iktot, const int nkstot, const Parallel_Orbitals &pv, const int nspin, std::ofstream &ofs_running, const int istep) |
| template void | write_wfc_nao< double > (const int out_type, const int out_app_flag, const psi::Psi< double > &psi, const ModuleBase::matrix &ekb, const ModuleBase::matrix &wg, const std::vector< ModuleBase::Vector3< double > > &kvec_c, const std::vector< int > &ik2iktot, const int nkstot, const Parallel_Orbitals &pv, const int nspin, std::ofstream &ofs_running, const int istep) |
| template void | write_wfc_nao< std::complex< double > > (const int out_type, const int out_app_flag, const psi::Psi< std::complex< double > > &psi, const ModuleBase::matrix &ekb, const ModuleBase::matrix &wg, const std::vector< ModuleBase::Vector3< double > > &kvec_c, const std::vector< int > &ik2iktot, const int nkstot, const Parallel_Orbitals &pv, const int nspin, std::ofstream &ofs_running, const int istep) |
| void | write_wfc_pw (const int istep, const int iter, const int append_step, const int kpar, const int my_pool, const int my_rank, const int nbands, const int nspin, const int npol, const int rank_in_pool, const int nproc_in_pool, const int out_wfc_pw, const int out_app_flag, const double &ecutwfc, const std::string &global_out_dir, const psi::Psi< std::complex< double > > &psi, const K_Vectors &kv, const ModulePW::PW_Basis_K *wfcpw, std::ofstream &ofs_running) |
| void | print_build_info () |
| void | parse_args (int argc, char **argv) |
| This function returns the version information when using command "abacus --version", "abacus -v" or "abacus -V"; returns the compilation details when using command "abacus --info", "abacus -i" or "abacus -I"; otherwise, it returns usage. | |
| int | run_control_option_size (int argc, char *argv[], int index) |
| CommandLineArgs | parse_command_line (int argc, char *argv[]) |
| void | print_help (const std::string &bin_name) |
| Prints a short pointer to the canonical general help on standard error. | |
| std::vector< double > | read_k (std::string filename, int ik) |
Internal helpers shared by the R-space sparse text writers. Declared here (instead of duplicated in each anonymous namespace) so the header layout, R records and file-append rules cannot diverge between hs_sparse_io.cpp, dhs_sparse_writer.cpp, pos_op_csr.cpp, hsr_writer.cpp and write_dmr.cpp.
Unit tests for the INPUT availability parser and metadata validator.
| using ModuleIO::DosSpectrum = std::vector<std::array<double, 5>> |
| using ModuleIO::InputValues = std::map<std::string, InputValue> |
| using ModuleIO::RCoordinate = Abfs::Vector3_Order<int> |
| using ModuleIO::SparseRBlock = std::map<size_t, std::map<size_t, T>> |
| using ModuleIO::SparseRMatrix = std::map<RCoordinate, SparseRBlock<T>> |
| using ModuleIO::TAC = std::pair<int, TC> |
| using ModuleIO::TC = std::array<int, 3> |
|
strong |
| double ModuleIO::all_band_energy | ( | const int | ik, |
| const std::vector< T > & | mat_mo, | ||
| const Parallel_Blkcyclic & | p2d, | ||
| const ModuleBase::matrix & | wg ) |
Sum over bands with occupation weights.
| T | Data type (double or std::complex<double>) |
| ik | K-point index |
| mat_mo | MO-space matrix |
| p2d | Parallel_Blkcyclic distribution |
| wg | Occupation weights |
| template double ModuleIO::all_band_energy< double > | ( | const int | , |
| const std::vector< double > & | , | ||
| const Parallel_Blkcyclic & | , | ||
| const ModuleBase::matrix & | ) |
| template double ModuleIO::all_band_energy< std::complex< double > > | ( | const int | , |
| const std::vector< std::complex< double > > & | , | ||
| const Parallel_Blkcyclic & | , | ||
| const ModuleBase::matrix & | ) |
| bool ModuleIO::assume_as_boolean | ( | const std::string & | val | ) |
| AvailabilityValueKind ModuleIO::availability_value_kind | ( | const std::string & | type | ) |
Convert the documentation type of an Input_Item into the type information needed to validate availability operators and literals.
| std::string ModuleIO::build_eband_header | ( | const int | istep, |
| const double | etot_eV, | ||
| const std::string & | term_symbol, | ||
| const std::string & | time_stamp ) |
Build the five comment lines preceding band-decomposed energy data.
| istep | Zero-based ionic step index, printed one-based. |
| etot_eV | Total energy of the written frame in eV. |
| term_symbol | Operator symbol used in the expectation value expression. |
| time_stamp | Timestamp shared by all files of the same run. |
| bool ModuleIO::cal_dos | ( | const int & | is, |
| const std::string & | fn, | ||
| const double & | de_ev, | ||
| const double & | emax_ev, | ||
| const double & | emin_ev, | ||
| const double & | bcoeff, | ||
| const int & | nks, | ||
| const int & | nkstot, | ||
| const std::vector< double > & | wk, | ||
| const std::vector< int > & | isk, | ||
| const int & | nbands, | ||
| const ModuleBase::matrix & | ekb, | ||
| const ModuleBase::matrix & | wg, | ||
| const int | istep_in, | ||
| const int | out_app_flag, | ||
| const int | precision, | ||
| const int | bndpar, | ||
| DosSpectrum * | spectrum ) |
| std::map< Abfs::Vector3_Order< int >, std::map< size_t, std::map< size_t, T > > > ModuleIO::cal_HR_sparse | ( | const hamilt::HContainer< T > & | hR, |
| const double | sparse_thr ) |
Helper to calculate sparse HR representation.
| void ModuleIO::cal_ldos_pw | ( | const elecstate::ElecStatePW< std::complex< double > > * | pelec, |
| const psi::Psi< std::complex< double >, Device > & | psi, | ||
| const Device * | ctx, | ||
| const Parallel_Grid & | pgrid, | ||
| const UnitCell & | ucell, | ||
| const std::vector< int > & | out_ldos, | ||
| const std::vector< double > & | stm_bias, | ||
| const int | nspin, | ||
| const int | istep, | ||
| const std::string & | global_out_dir, | ||
| const bool | two_fermi, | ||
| const int | nbands, | ||
| const double | dos_edelta_ev, | ||
| const double | dos_scale, | ||
| const bool | dos_setemax, | ||
| const double | dos_emax_ev, | ||
| const bool | dos_setemin, | ||
| const double | dos_emin_ev, | ||
| const double | dos_sigma, | ||
| const std::vector< double > & | ldos_line, | ||
| std::ofstream & | ofs_running ) |
| template void ModuleIO::cal_ldos_pw< base_device::DEVICE_CPU > | ( | const elecstate::ElecStatePW< std::complex< double > > * | pelec, |
| const psi::Psi< std::complex< double >, base_device::DEVICE_CPU > & | psi, | ||
| const base_device::DEVICE_CPU * | ctx, | ||
| const Parallel_Grid & | pgrid, | ||
| const UnitCell & | ucell, | ||
| const std::vector< int > & | out_ldos, | ||
| const std::vector< double > & | stm_bias, | ||
| const int | nspin, | ||
| const int | istep, | ||
| const std::string & | global_out_dir, | ||
| const bool | two_fermi, | ||
| const int | nbands, | ||
| const double | dos_edelta_ev, | ||
| const double | dos_scale, | ||
| const bool | dos_setemax, | ||
| const double | dos_emax_ev, | ||
| const bool | dos_setemin, | ||
| const double | dos_emin_ev, | ||
| const double | dos_sigma, | ||
| const std::vector< double > & | ldos_line, | ||
| std::ofstream & | ofs_running ) |
| std::complex< double > ModuleIO::cal_LxijR | ( | const std::unique_ptr< TwoCenterIntegrator > & | calculator, |
| const int | it, | ||
| const int | ia, | ||
| const int | il, | ||
| const int | iz, | ||
| const int | im, | ||
| const int | jt, | ||
| const int | ja, | ||
| const int | jl, | ||
| const int | jz, | ||
| const int | jm, | ||
| const ModuleBase::Vector3< double > & | vR ) |
calculate the <phi_i|Lx|phi_j> matrix elements, in which the Lz are the angular momentum operators, |phi_i> and |phi_j> are the numerical atomic orbitals (NAOs).
| calculator | the std::unique_ptr<TwoCenterIntegrator> instance |
| it | atomtype index of the first atom |
| ia | atomic index of the first atom within the atomtype |
| il | angular momentum index of the first atom |
| iz | zeta function index of the first atom |
| mi | magnetic quantum number of the first atom |
| jt | atomtype index of the second atom |
| ja | atomic index of the second atom within the atomtype |
| jl | angular momentum index of the second atom |
| jz | zeta function index of the second atom |
| mj | magnetic quantum number of the second atom |
| vR | the vector from the first atom to the second atom |
| std::complex< double > ModuleIO::cal_LyijR | ( | const std::unique_ptr< TwoCenterIntegrator > & | calculator, |
| const int | it, | ||
| const int | ia, | ||
| const int | il, | ||
| const int | iz, | ||
| const int | im, | ||
| const int | jt, | ||
| const int | ja, | ||
| const int | jl, | ||
| const int | jz, | ||
| const int | jm, | ||
| const ModuleBase::Vector3< double > & | vR ) |
calculate the <phi_i|Ly|phi_j> matrix elements, in which the Lz are the angular momentum operators, |phi_i> and |phi_j> are the numerical atomic orbitals (NAOs).
| calculator | the std::unique_ptr<TwoCenterIntegrator> instance |
| it | atomtype index of the first atom |
| ia | atomic index of the first atom within the atomtype |
| il | angular momentum index of the first atom |
| iz | zeta function index of the first atom |
| mi | magnetic quantum number of the first atom |
| jt | atomtype index of the second atom |
| ja | atomic index of the second atom within the atomtype |
| jl | angular momentum index of the second atom |
| jz | zeta function index of the second atom |
| mj | magnetic quantum number of the second atom |
| vR | the vector from the first atom to the second atom |
| std::complex< double > ModuleIO::cal_LzijR | ( | const std::unique_ptr< TwoCenterIntegrator > & | calculator, |
| const int | it, | ||
| const int | ia, | ||
| const int | il, | ||
| const int | iz, | ||
| const int | mi, | ||
| const int | jt, | ||
| const int | ja, | ||
| const int | jl, | ||
| const int | jz, | ||
| const int | mj, | ||
| const ModuleBase::Vector3< double > & | vR ) |
calculate the <phi_i|Lz|phi_j> matrix elements, in which the Lz are the angular momentum operators, |phi_i> and |phi_j> are the numerical atomic orbitals (NAOs).
| calculator | the std::unique_ptr<TwoCenterIntegrator> instance |
| it | atomtype index of the first atom |
| ia | atomic index of the first atom within the atomtype |
| il | angular momentum index of the first atom |
| iz | zeta function index of the first atom |
| mi | magnetic quantum number of the first atom |
| jt | atomtype index of the second atom |
| ja | atomic index of the second atom within the atomtype |
| jl | angular momentum index of the second atom |
| jz | zeta function index of the second atom |
| mj | magnetic quantum number of the second atom |
| vR | the vector from the first atom to the second atom |
| void ModuleIO::cal_mag | ( | Parallel_Orbitals * | pv, |
| hamilt::Hamilt< TK > * | p_ham, | ||
| K_Vectors & | kv, | ||
| module_dm::DensityMatrix< TK, double > * | dm, | ||
| const TwoCenterBundle & | two_center_bundle, | ||
| const LCAO_Orbitals & | orb, | ||
| UnitCell & | ucell, | ||
| const Grid_Driver & | gd, | ||
| const int | istep, | ||
| const int | out_app_flag, | ||
| const bool | print ) |
| std::vector< ModuleBase::matrix > ModuleIO::cal_pdos | ( | const psi::Psi< double > * | psi, |
| hamilt::Hamilt< double > * | p_ham, | ||
| const Parallel_Orbitals & | pv, | ||
| const K_Vectors & | kv, | ||
| const int | nspin0, | ||
| const int | nbands, | ||
| const ModuleBase::matrix & | ekb, | ||
| const double & | emax, | ||
| const double & | emin, | ||
| const double & | dos_edelta_ev, | ||
| const double & | bcoeff, | ||
| const int | nlocal, | ||
| const int | nspin ) |
| std::vector< ModuleBase::matrix > ModuleIO::cal_pdos | ( | const psi::Psi< std::complex< double > > * | psi, |
| hamilt::Hamilt< std::complex< double > > * | p_ham, | ||
| const Parallel_Orbitals & | pv, | ||
| const K_Vectors & | kv, | ||
| const int | nspin0, | ||
| const int | nbands, | ||
| const ModuleBase::matrix & | ekb, | ||
| const double & | emax, | ||
| const double & | emin, | ||
| const double & | dos_edelta_ev, | ||
| const double & | bcoeff, | ||
| const int | nlocal, | ||
| const int | nspin ) |
| std::map< Abfs::Vector3_Order< int >, std::map< size_t, std::map< size_t, Tdata > > > ModuleIO::calculate_RI_Tensor_sparse | ( | const double & | sparse_threshold, |
| const std::map< int, std::map< TAC, RI::Tensor< Tdata > > > & | Hexxs, | ||
| const UnitCell & | ucell ) |
calculate CSR sparse matrix from the global matrix stored with RI::Tensor the return type is same as SR_sparse, HR_sparse, etc.
| template std::map< Abfs::Vector3_Order< int >, std::map< size_t, std::map< size_t, double > > > ModuleIO::calculate_RI_Tensor_sparse< double > | ( | const double & | , |
| const std::map< int, std::map< TAC, RI::Tensor< double > > > & | , | ||
| const UnitCell & | ) |
| template std::map< Abfs::Vector3_Order< int >, std::map< size_t, std::map< size_t, std::complex< double > > > > ModuleIO::calculate_RI_Tensor_sparse< std::complex< double > > | ( | const double & | , |
| const std::map< int, std::map< TAC, RI::Tensor< std::complex< double > > > > & | , | ||
| const UnitCell & | ) |
| bool ModuleIO::check_sccs_inp | ( | const Input_para & | input, |
| std::string & | error ) |
| void ModuleIO::check_td_efield_parameters | ( | const Input_para & | input | ) |
Validate the structure and waveform-defining constraints of RT-TDDFT fields.
| input | Input parameters after all values and dynamic defaults are resolved. |
| void ModuleIO::check_td_vecpot_paths | ( | const std::string & | input_dir, |
| const std::string & | output_dir ) |
Reject output that aliases the input file, including symbolic and hard links.
| void ModuleIO::collect_MW_nspin4 | ( | ModuleBase::matrix & | MecMulP, |
| const ModuleBase::ComplexMatrix & | mud, | ||
| int | nw, | ||
| const Parallel_Orbitals * | pv ) |
Accumulate the nspin=4 Mulliken charge and Mx/My/Mz components.
Decomposes one k-point mud = DM*S^T into the Pauli components using the conj-first DM convention (DM = conj(P), see dm_from_psi.h): Mx = Re(mud_ud + mud_du), My = Im(mud_ud - mud_du), Mz = Re(mud_uu - mud_dd).
| MecMulP | accumulators [4 x nw/2]: 0 = charge, 1/2/3 = Mx/My/Mz |
| mud | DM*S^T stored in ScaLAPACK column-major layout |
| nw | total number of spinor orbitals (2 * number of spatial orbitals) |
| pv | orbital distribution mapping |
| void ModuleIO::ctrl_iter_lcao | ( | UnitCell & | ucell, |
| const Input_para & | inp, | ||
| K_Vectors & | kv, | ||
| elecstate::ElecState * | pelec, | ||
| module_dm::DensityMatrix< TK, double > & | dm, | ||
| Parallel_Orbitals & | pv, | ||
| Grid_Driver & | gd, | ||
| psi::Psi< TK > * | psi, | ||
| Charge & | chr, | ||
| Charge_Mixing * | p_chgmix, | ||
| hamilt::HamiltLCAO< TK, TR > * | p_hamilt, | ||
| LCAO_Orbitals & | orb, | ||
| Setup_DeePKS< TK > & | deepks, | ||
| Exx_NAO< TK > & | exx_nao, | ||
| const Exx_Info & | exx_info, | ||
| int & | iter, | ||
| const int | istep, | ||
| bool & | conv_esolver, | ||
| const double & | scf_ene_thr ) |
| template void ModuleIO::ctrl_iter_lcao< double, double > | ( | UnitCell & | ucell, |
| const Input_para & | inp, | ||
| K_Vectors & | kv, | ||
| elecstate::ElecState * | pelec, | ||
| module_dm::DensityMatrix< double, double > & | dm, | ||
| Parallel_Orbitals & | pv, | ||
| Grid_Driver & | gd, | ||
| psi::Psi< double > * | psi, | ||
| Charge & | chr, | ||
| Charge_Mixing * | p_chgmix, | ||
| hamilt::HamiltLCAO< double, double > * | p_hamilt, | ||
| LCAO_Orbitals & | orb, | ||
| Setup_DeePKS< double > & | deepks, | ||
| Exx_NAO< double > & | exx_nao, | ||
| const Exx_Info & | exx_info, | ||
| int & | iter, | ||
| const int | istep, | ||
| bool & | conv_esolver, | ||
| const double & | scf_ene_thr ) |
| template void ModuleIO::ctrl_iter_lcao< std::complex< double >, double > | ( | UnitCell & | ucell, |
| const Input_para & | inp, | ||
| K_Vectors & | kv, | ||
| elecstate::ElecState * | pelec, | ||
| module_dm::DensityMatrix< std::complex< double >, double > & | dm, | ||
| Parallel_Orbitals & | pv, | ||
| Grid_Driver & | gd, | ||
| psi::Psi< std::complex< double > > * | psi, | ||
| Charge & | chr, | ||
| Charge_Mixing * | p_chgmix, | ||
| hamilt::HamiltLCAO< std::complex< double >, double > * | p_hamilt, | ||
| LCAO_Orbitals & | orb, | ||
| Setup_DeePKS< std::complex< double > > & | deepks, | ||
| Exx_NAO< std::complex< double > > & | exx_nao, | ||
| const Exx_Info & | exx_info, | ||
| int & | iter, | ||
| const int | istep, | ||
| bool & | conv_esolver, | ||
| const double & | scf_ene_thr ) |
| void ModuleIO::ctrl_iter_pw | ( | const int | istep, |
| const int | iter, | ||
| const double & | conv_esolver, | ||
| Setup_Psi_pw & | stp, | ||
| const K_Vectors & | kv, | ||
| const ModulePW::PW_Basis_K * | pw_wfc, | ||
| const Input_para & | inp, | ||
| bool | final_output, | ||
| std::ofstream & | ofs_running ) |
| void ModuleIO::ctrl_output_fp | ( | UnitCell & | ucell, |
| const Input_para & | inp, | ||
| elecstate::ElecState * | pelec, | ||
| ModulePW::PW_Basis_Big * | pw_big, | ||
| ModulePW::PW_Basis * | pw_rhod, | ||
| Charge & | chr, | ||
| surchem & | solvent, | ||
| Parallel_Grid & | para_grid, | ||
| const int | istep, | ||
| std::ofstream & | ofs_running ) |
| void ModuleIO::ctrl_output_td | ( | const UnitCell & | ucell, |
| double ** | rho_save, | ||
| const ModulePW::PW_Basis * | rhopw, | ||
| const int | istep, | ||
| const psi::Psi< std::complex< double > > * | psi, | ||
| const elecstate::ElecState * | pelec, | ||
| const K_Vectors & | kv, | ||
| const TwoCenterIntegrator * | intor, | ||
| const Parallel_Orbitals * | pv, | ||
| const LCAO_Orbitals & | orb, | ||
| const Velocity_op< TR > * | velocity_mat, | ||
| const Grid_Driver & | grid, | ||
| hamilt::HamiltLCAO< std::complex< double >, TR > * | p_hamilt, | ||
| Record_adj & | RA, | ||
| TD_info * | td_p, | ||
| const Exx_NAO< std::complex< double > > & | exx_nao, | ||
| const Exx_Info & | exx_info ) |
| template void ModuleIO::ctrl_output_td< double > | ( | const UnitCell & | , |
| double ** | , | ||
| const ModulePW::PW_Basis * | , | ||
| const int | , | ||
| const psi::Psi< std::complex< double > > * | , | ||
| const elecstate::ElecState * | , | ||
| const K_Vectors & | , | ||
| const TwoCenterIntegrator * | , | ||
| const Parallel_Orbitals * | , | ||
| const LCAO_Orbitals & | , | ||
| const Velocity_op< double > * | , | ||
| const Grid_Driver & | , | ||
| hamilt::HamiltLCAO< std::complex< double >, double > * | , | ||
| Record_adj & | , | ||
| TD_info * | , | ||
| const Exx_NAO< std::complex< double > > & | , | ||
| const Exx_Info & | ) |
| template void ModuleIO::ctrl_output_td< std::complex< double > > | ( | const UnitCell & | , |
| double ** | , | ||
| const ModulePW::PW_Basis * | , | ||
| const int | , | ||
| const psi::Psi< std::complex< double > > * | , | ||
| const elecstate::ElecState * | , | ||
| const K_Vectors & | , | ||
| const TwoCenterIntegrator * | , | ||
| const Parallel_Orbitals * | , | ||
| const LCAO_Orbitals & | , | ||
| const Velocity_op< std::complex< double > > * | , | ||
| const Grid_Driver & | , | ||
| hamilt::HamiltLCAO< std::complex< double >, std::complex< double > > * | , | ||
| Record_adj & | , | ||
| TD_info * | , | ||
| const Exx_NAO< std::complex< double > > & | , | ||
| const Exx_Info & | ) |
| void ModuleIO::ctrl_output_td_pw | ( | const pw::TDVelResultPW & | currents, |
| const pw::TDSpinResultPW & | moments, | ||
| const pw::CurrentRequest & | request, | ||
| const std::string & | mag_partition, | ||
| const std::string & | orbital_dir, | ||
| double | onsite_radius, | ||
| bool | calc_torque, | ||
| const std::vector< std::string > & | orbital_fn, | ||
| int | step, | ||
| double | dt_ha, | ||
| int | nspin, | ||
| int | nkstot, | ||
| int | rank, | ||
| const std::string & | directory, | ||
| std::ostream & | log ) |
Write precomputed endpoint observables on the designated output rank.
| void ModuleIO::ctrl_runner_lcao | ( | UnitCell & | ucell, |
| const Input_para & | inp, | ||
| const int | istep, | ||
| K_Vectors & | kv, | ||
| elecstate::ElecState * | pelec, | ||
| const module_dm::Setup_DM< TK > & | dmat, | ||
| Parallel_Orbitals & | pv, | ||
| Parallel_Grid & | pgrid, | ||
| Grid_Driver & | gd, | ||
| psi::Psi< TK > * | psi, | ||
| Charge & | chr, | ||
| hamilt::HamiltLCAO< TK, TR > * | p_hamilt, | ||
| TwoCenterBundle & | two_center_bundle, | ||
| LCAO_Orbitals & | orb, | ||
| ModulePW::PW_Basis * | pw_rho, | ||
| ModulePW::PW_Basis * | pw_rhod, | ||
| Structure_Factor & | sf, | ||
| ModuleBase::matrix & | vloc, | ||
| Exx_NAO< TK > & | exx_nao, | ||
| const Exx_Info & | exx_info, | ||
| surchem & | solvent, | ||
| std::ofstream & | ofs_running ) |
| template void ModuleIO::ctrl_runner_lcao< double, double > | ( | UnitCell & | ucell, |
| const Input_para & | inp, | ||
| const int | istep, | ||
| K_Vectors & | kv, | ||
| elecstate::ElecState * | pelec, | ||
| const module_dm::Setup_DM< double > & | dmat, | ||
| Parallel_Orbitals & | pv, | ||
| Parallel_Grid & | pgrid, | ||
| Grid_Driver & | gd, | ||
| psi::Psi< double > * | psi, | ||
| Charge & | chr, | ||
| hamilt::HamiltLCAO< double, double > * | p_hamilt, | ||
| TwoCenterBundle & | two_center_bundle, | ||
| LCAO_Orbitals & | orb, | ||
| ModulePW::PW_Basis * | pw_rho, | ||
| ModulePW::PW_Basis * | pw_rhod, | ||
| Structure_Factor & | sf, | ||
| ModuleBase::matrix & | vloc, | ||
| Exx_NAO< double > & | exx_nao, | ||
| const Exx_Info & | exx_info, | ||
| surchem & | solvent, | ||
| std::ofstream & | ofs_running ) |
| template void ModuleIO::ctrl_runner_lcao< std::complex< double >, double > | ( | UnitCell & | ucell, |
| const Input_para & | inp, | ||
| const int | istep, | ||
| K_Vectors & | kv, | ||
| elecstate::ElecState * | pelec, | ||
| const module_dm::Setup_DM< std::complex< double > > & | dmat, | ||
| Parallel_Orbitals & | pv, | ||
| Parallel_Grid & | pgrid, | ||
| Grid_Driver & | gd, | ||
| psi::Psi< std::complex< double > > * | psi, | ||
| Charge & | chr, | ||
| hamilt::HamiltLCAO< std::complex< double >, double > * | p_hamilt, | ||
| TwoCenterBundle & | two_center_bundle, | ||
| LCAO_Orbitals & | orb, | ||
| ModulePW::PW_Basis * | pw_rho, | ||
| ModulePW::PW_Basis * | pw_rhod, | ||
| Structure_Factor & | sf, | ||
| ModuleBase::matrix & | vloc, | ||
| Exx_NAO< std::complex< double > > & | exx_nao, | ||
| const Exx_Info & | exx_info, | ||
| surchem & | solvent, | ||
| std::ofstream & | ofs_running ) |
| void ModuleIO::ctrl_runner_pw | ( | UnitCell & | ucell, |
| elecstate::ElecState * | pelec, | ||
| ModulePW::PW_Basis_K * | pw_wfc, | ||
| ModulePW::PW_Basis * | pw_rho, | ||
| ModulePW::PW_Basis * | pw_rhod, | ||
| Charge & | chr, | ||
| K_Vectors & | kv, | ||
| Setup_Psi_pw & | stp, | ||
| Structure_Factor & | sf, | ||
| pseudopot_cell_vnl & | ppcell, | ||
| surchem & | solvent, | ||
| const base_device::DeviceContext * | ctx, | ||
| Parallel_Grid & | para_grid, | ||
| const Input_para & | inp, | ||
| std::ofstream & | ofs_running ) |
| template void ModuleIO::ctrl_runner_pw< std::complex< double >, base_device::DEVICE_CPU > | ( | UnitCell & | ucell, |
| elecstate::ElecState * | pelec, | ||
| ModulePW::PW_Basis_K * | pw_wfc, | ||
| ModulePW::PW_Basis * | pw_rho, | ||
| ModulePW::PW_Basis * | pw_rhod, | ||
| Charge & | chr, | ||
| K_Vectors & | kv, | ||
| Setup_Psi_pw & | stp, | ||
| Structure_Factor & | sf, | ||
| pseudopot_cell_vnl & | ppcell, | ||
| surchem & | solvent, | ||
| Parallel_Grid & | para_grid, | ||
| const int | istep, | ||
| const Input_para & | inp, | ||
| std::ofstream & | ofs_running ) |
1) Compute LDOS
2) Calculate the spillage value, which are used to generate numerical atomic orbitals
3) Use Kubo-Greenwood method to compute conductivities
4) generate training data for ML-KEDF
| void ModuleIO::ctrl_scf_lcao | ( | UnitCell & | ucell, |
| const Input_para & | inp, | ||
| K_Vectors & | kv, | ||
| elecstate::ElecState * | pelec, | ||
| module_dm::DensityMatrix< TK, double > * | dm, | ||
| Parallel_Orbitals & | pv, | ||
| Grid_Driver & | gd, | ||
| psi::Psi< TK > * | psi, | ||
| hamilt::HamiltLCAO< TK, TR > * | p_hamilt, | ||
| Plus_U_Base & | dftu, | ||
| TwoCenterBundle & | two_center_bundle, | ||
| LCAO_Orbitals & | orb, | ||
| const ModulePW::PW_Basis_K * | pw_wfc, | ||
| const ModulePW::PW_Basis * | pw_rho, | ||
| const ModulePW::PW_Basis_Big * | pw_big, | ||
| Structure_Factor & | sf, | ||
| const ModulePW::PW_Basis * | pw_rhod, | ||
| const ModuleBase::matrix & | vloc, | ||
| surchem & | solvent, | ||
| rdmft::RDMFT< TK, TR > & | rdmft_solver, | ||
| Setup_DeePKS< TK > & | deepks, | ||
| Exx_NAO< TK > & | exx_nao, | ||
| const Exx_Info & | exx_info, | ||
| const bool | conv_esolver, | ||
| const bool | scf_nmax_flag, | ||
| const bool | last_ion_step, | ||
| const int | istep, | ||
| std::ofstream & | ofs_running ) |
1) print out density of states (DOS)
2) Output density matrix DM(R)
3) Output density matrix DM(k)
5) Output electronic wavefunctions Psi(k)
6) Output DeePKS information
7a) Output H(R) and S(R) matrices in CSR format
7a.1) Output H(R), S(R), and DM(R) matrices in NPZ format
7b) Output dH, dS, T, r matrices (old sparse path, without H/S), only for multi-k
7c) Output atomic dH components (dT/dτ, dV^NL/dτ, dV^L/dτ, dV^H/dτ, dV^XC/dτ), only for nspin =1, 2 now
7d) Output H components (T, Vnl, Vl, Vh, Vxc)
8) Output kinetic matrix
8b) Output exchange-correlation potential and band-decomposed energies
9) Output expectation of angular momentum operator
10) Output Mulliken charge
11) Output atomic magnetization by using 'spin_constraint'
12) Output Berry phase
13) Wannier90 interface in LCAO basis
17) Perform RDMFT calculations, added by jghan, 2024-10-17
initialize the gradients of Etotal with respect to occupation numbers and wfc, and set all elements to 0. dedocc = d E/d Occ_Num
dedwfc = d E/d wfc
17) Output quasi orbitals
18) Calculate and output asynchronous overlap matrix for Hefei-NAMD
| template void ModuleIO::ctrl_scf_pw< std::complex< double >, base_device::DEVICE_CPU > | ( | const int | istep, |
| UnitCell & | ucell, | ||
| elecstate::ElecState * | pelec, | ||
| const Charge & | chr, | ||
| const pseudopot_cell_vnl & | ppcell, | ||
| const K_Vectors & | kv, | ||
| const ModulePW::PW_Basis_K * | pw_wfc, | ||
| const ModulePW::PW_Basis * | pw_rho, | ||
| const ModulePW::PW_Basis * | pw_rhod, | ||
| const ModulePW::PW_Basis_Big * | pw_big, | ||
| Setup_Psi_pw & | stp, | ||
| const Parallel_Grid & | para_grid, | ||
| const Input_para & | inp, | ||
| std::ofstream & | ofs_running ) |
4) Compute density of states (DOS)
6) calculate Wannier functions in pw basis
7) calculate Berry phase polarization in pw basis
| std::vector< T > ModuleIO::cVc | ( | const T * | V, |
| const T * | c, | ||
| const int | nbasis, | ||
| const int | nbands, | ||
| const Parallel_Orbitals & | pv, | ||
| const Parallel_Blkcyclic & | p2d ) |
Compute c^dagger * V * c in MO basis.
| T | Data type (double or std::complex<double>) |
| V | AO-space matrix V (nbasis x nbasis) |
| c | AO-to-MO transformation coefficients (nbasis x nbands) |
| nbasis | Number of AO basis functions |
| nbands | Number of bands |
| pv | Parallel_Orbitals for AO distribution |
| p2d | Parallel_Blkcyclic for MO distribution |
| template std::vector< double > ModuleIO::cVc< double > | ( | const double * | , |
| const double * | , | ||
| const int | , | ||
| const int | , | ||
| const Parallel_Orbitals & | , | ||
| const Parallel_Blkcyclic & | ) |
| template std::vector< std::complex< double > > ModuleIO::cVc< std::complex< double > > | ( | const std::complex< double > * | , |
| const std::complex< double > * | , | ||
| const int | , | ||
| const int | , | ||
| const Parallel_Orbitals & | , | ||
| const Parallel_Blkcyclic & | ) |
| std::size_t ModuleIO::dense_buffer_index | ( | const int | i, |
| const int | j, | ||
| const int | nlocal, | ||
| const bool | column_major ) |
Flat index of matrix element (i, j) in a gathered buffer.
A row-major buffer stores (i, j) at i * nlocal + j, while a column-major buffer stores it at j * nlocal + i. Writers and readers of the flat NAO text layout must share this mapping so that the file always stays row-major.
| [in] | i | row index, must be non-negative |
| [in] | j | column index, must be non-negative |
| [in] | nlocal | matrix dimension, must be positive |
| [in] | column_major | whether the buffer is stored column-major |
|
inline |
| std::string ModuleIO::dhk_gen_fname | ( | const std::string & | prefix, |
| const int | ispin, | ||
| const int | nspin, | ||
| const bool | numbered, | ||
| const int | istep ) |
Generate filename for the k-space derivative matrices (dH(k), dT(k), ...). A spin suffix is added only for nspin == 2 so the two spin channels do not overwrite each other; a single spin channel keeps the bare name.
| numbered | whether the ionic step is embedded as a g{step} suffix (out_app_flag == 2) |
| std::string ModuleIO::dhr_gen_fname | ( | const std::string & | prefix, |
| const int | ispin, | ||
| const bool | numbered, | ||
| const int | istep ) |
Generate filename for derivative matrices (dH/dR, dS/dR).
| std::string ModuleIO::dmk_gen_fname | ( | const bool | gamma_only, |
| const int | ispin, | ||
| const int | nspin, | ||
| const int | ik, | ||
| const int | istep ) |
Generates the filename for the DMK file based on the given parameters.
| gamma_only | Whether the calculation is gamma_only. |
| ispin | The index of the spin component. |
| ik | The index of the k-point. |
| bool ModuleIO::dmk_readData | ( | std::ifstream & | ifs, |
| double & | data ) |
Read one double from a file.
| bool ModuleIO::dmk_readData | ( | std::ifstream & | ifs, |
| std::complex< double > & | data ) |
Read one complex double from a file.
| std::string ModuleIO::dmr_gen_fname | ( | const int | out_type, |
| const int | ispin, | ||
| const bool | numbered = false, | ||
| const int | istep = -1 ) |
Generates a filename for the DMR output based on the given parameters.
| out_type | The output type. 1: csr, 2: npz. |
| ispin | The spin value, starting from 0. |
| numbered | Whether the ionic step is embedded in the filename as a g{step} suffix (true for out_app_flag == 2). |
| istep | The ION step (default: -1), starting from 0. |
|
inline |
The k-point pool count actually consumed by the current basis.
After ReadInput::reset_value, exactly one of (kpar, kpar_lcao) carries the user value and the other is 1. Select explicitly by basis_type instead of std::max so the invariant is documented and enforced.
|
inline |
Check whether a k-point/band parallel layout satisfies the DSP vendor library constraint.
On DSP hardware, the mtblas/C_PACK libraries require exactly one MPI process per k-point pool: the effective pool count (kpar for PW, kpar_lcao for LCAO) times bndpar must equal nproc exactly. Non-positive nproc / pool count / bndpar are invalid layouts. Always returns true when esolver_type is dp or nep. See issue #8228.
|
inline |
Whether the DSP kpar/bndpar layout constraint applies.
esolver_type = dp / nep are machine-learning interatomic-potential solvers: they never build a PW/LCAO Hamiltonian, never construct k-point pools or band groups, and never call the mtblas/C_PACK vendor libraries, so the layout constraint is inapplicable. Comparison is case-insensitive. See issue #8228.
| std::string ModuleIO::eband_filename | ( | const std::string & | stem, |
| const int | istep, | ||
| const int | out_app_flag ) |
Compose the name of a band-decomposed energy file.
| stem | Base name without extension, e.g. "eband_vxc" |
| istep | Zero-based ionic step index; mode 2 prints it one-based |
| out_app_flag | Output mode: 2 appends g{step} to the stem |
| bool ModuleIO::evaluate_input_condition | ( | const AvailabilityExpr & | expression, |
| const InputValues & | values ) |
| std::string ModuleIO::filename_output | ( | const std::string & | directory, |
| const std::string & | property, | ||
| const std::string & | basis, | ||
| const int | ik_local, | ||
| const std::vector< int > & | ik2iktot, | ||
| const int | nspin, | ||
| const int | nkstot, | ||
| const int | out_type, | ||
| const int | out_app_flag, | ||
| const bool | gamma_only, | ||
| const int | istep = -1, | ||
| const int | iter = -1 ) |
Generates the filename for the output files
| directory | directory of the file |
| property | wave function (wf), charge density (chg) or matrix (mat) |
| basis | nao or pw |
| ik_local | index of the k-points within each pool, and starting from 0. |
| ik2iktot | map from ik to iktot |
| nspin | number of spin channels, 1,2 or 4 |
| nkstot | number of total k-points |
| out_type | two types of output file format, 1 for .txt and 2 for .dat (binary) |
| out_app_flag | 0=fixed filename, overwritten at each write; 1=fixed filename, appended; 2=subdirectory layout with a g{step} suffix. |
| gamma_only | gamma_only algorithm or not. |
| istep | index of the ion step starting from 0. The step number is only embedded in the filename in mode 2 (out_app_flag == 2), and only when istep >= 0. |
| iter | index of the electronic step starting from 0. The step number is only embedded in the filename in mode 2 (out_app_flag == 2), and only when iter >= 0. |
| bool ModuleIO::filter_nonascii_and_comment | ( | std::ifstream & | ifs, |
| std::stringstream & | out_ascii_stream ) |
|
inline |
Tell whether an output written for ionic step istep should append.
Mode 1 appends every frame after the first ionic step, keeping one trajectory file. Mode 0 truncates to the latest snapshot and mode 2 writes a separate file per step, so neither of them appends.
| out_app_flag | Output append mode, must be 0, 1 or 2. |
| istep | Zero-based ionic step index, must be non-negative. |
| std::invalid_argument | if out_app_flag or istep is out of range. |
| std::string ModuleIO::gen_ini_filename | ( | const std::string & | prefix, |
| const std::string & | out_dir, | ||
| const int | nspin, | ||
| const int | is, | ||
| const int | istep, | ||
| const bool | include_geom_step ) |
| void ModuleIO::get_grid_points | ( | const std::vector< double > & | start, |
| const std::vector< double > & | end, | ||
| const int & | npoints, | ||
| const int & | nx, | ||
| const int & | ny, | ||
| const int & | nz, | ||
| std::vector< std::vector< int > > & | points, | ||
| std::vector< std::vector< double > > & | shifts ) |
|
inline |
Extract real part (for real numbers, identity).
|
inline |
Extract real part (for complex numbers).
| std::string ModuleIO::hsr_gen_fname | ( | const std::string & | prefix, |
| const int | ispin, | ||
| const bool | numbered, | ||
| const int | istep ) |
Generate filename for spin-dependent HR output.
| numbered | whether the ionic step is embedded as a g{step} suffix (out_app_flag == 2) |
| std::string ModuleIO::hsr_gen_fname | ( | const std::string & | prefix, |
| const int | ispin, | ||
| const bool | numbered, | ||
| const int | istep, | ||
| const int | out_type ) |
Generate filename for spin-dependent HR output in the selected format.
| std::string ModuleIO::input_diagnostic | ( | const std::string & | label, |
| const std::string & | value, | ||
| const std::string & | origin, | ||
| const std::string & | expected ) |
| std::string ModuleIO::input_manual_link | ( | const std::string & | label | ) |
| void ModuleIO::ldos_mode_pw | ( | const elecstate::ElecStatePW< std::complex< double > > * | pelec, |
| const psi::Psi< std::complex< double >, Device > & | psi, | ||
| const Device * | ctx, | ||
| const Parallel_Grid & | pgrid, | ||
| const UnitCell & | ucell, | ||
| const int | istep, | ||
| const std::string & | global_out_dir, | ||
| const int | nbands, | ||
| const double | dos_edelta_ev, | ||
| const double | dos_scale, | ||
| const bool | dos_setemax, | ||
| const double | dos_emax_ev, | ||
| const bool | dos_setemin, | ||
| const double | dos_emin_ev, | ||
| const bool | two_fermi, | ||
| const double | dos_sigma, | ||
| const std::vector< double > & | ldos_line, | ||
| std::ofstream & | ofs_running ) |
| std::vector< std::string > ModuleIO::libxc_r_channel_suffixes | ( | const std::string & | data_name, |
| int | nspin ) |
Build the channel suffixes appended to the cube file names of one Libxc quantity.
The suffix encodes the Libxc channel index tuple, which differs per quantity order:
| data_name | Quantity label used in the file name (e.g. "v2rhosigma"). |
| nspin | Number of spin channels of the calculation, 1 or 2. |
| std::invalid_argument | if nspin is not 1 or 2, or data_name is unknown. |
|
inline |
Local wall-clock timestamp "YYYY-MM-DD HH:MM:SS" for the provenance header of output files. Call once per frame and pass the result to provenance_header() so all files of the same frame carry one timestamp.
| std::string ModuleIO::longstring | ( | const std::vector< std::string > & | words | ) |
|
inline |
Compact spin-channel label used in per-spin output files (bands1.txt, wfk1s1_nao.txt, ...). Unlike make_spin_tag, which pads "up" so both channels share one width in the running log, this form is unpadded because it heads a file that holds a single channel. Returns " (spin up)", " (spin down)" or an empty string.
|
inline |
Build a descriptive label for the data channel at spin index is. For nspin==2 and is>=0: appends " (spin up )" or " (spin down)". For nspin==4 and is>0: returns mag_base with the axis letter appended, e.g. mag_base "magnetization density m" yields "magnetization density mx". For nspin==1, nspin==4 with is==0, or spin-summed calls (is<0): no suffix.
| base | label of the scalar channel (is == 0), e.g. "charge density". |
| mag_base | label of the nspin==4 magnetic channels (is = 1..3), ending with the component letter: "m" for magnetization densities (rho[1..3]), "b" for magnetic fields (the B_xc components of the effective potential). |
|
inline |
Running-log suffix naming the collinear spin channel of an output. Returns " (spin up )" for nspin==2 and is==0, " (spin down)" for nspin==2 and is==1, and an empty string otherwise (nspin==1, nspin==4, or is<0).
| std::string ModuleIO::nofound_str | ( | std::vector< std::string > | init_chgs, |
| const std::string & | str ) |
| void ModuleIO::nscf_bands | ( | const int & | is, |
| const std::string & | eig_file, | ||
| const int & | nband, | ||
| const double & | fermie, | ||
| const int & | precision, | ||
| const ModuleBase::matrix & | ekb, | ||
| const K_Vectors & | kv, | ||
| const std::string & | header, | ||
| const int | out_app_flag ) |
calculate the band structure
| is | spin index is = 0 or 1 |
| eig_file | file to save the band structure |
| nband | number of bands |
| fermie | fermi energy |
| precision | precision of the output |
| ekb | eigenvalues of k points and bands |
| kv | klist |
| header | provenance header written once in front of the k-point block; pass an empty string to omit it |
| out_app_flag | output append mode: 0 = truncate, 1 = append |
first find if present kpoint in present pool
then get the local kpoint index, which starts definitly from 0
if present kpoint corresponds the spin of the present one
| std::vector< double > ModuleIO::orbital_energy | ( | const int | ik, |
| const int | nbands, | ||
| const std::vector< T > & | mat_mo, | ||
| const Parallel_Blkcyclic & | p2d ) |
Extract diagonal elements (orbital energies) from MO matrix.
| T | Data type (double or std::complex<double>) |
| ik | K-point index (for occupancy weights) |
| nbands | Number of bands |
| mat_mo | MO-space matrix |
| p2d | Parallel_Blkcyclic distribution |
| template std::vector< double > ModuleIO::orbital_energy< double > | ( | const int | , |
| const int | , | ||
| const std::vector< double > & | , | ||
| const Parallel_Blkcyclic & | ) |
| template std::vector< double > ModuleIO::orbital_energy< std::complex< double > > | ( | const int | , |
| const int | , | ||
| const std::vector< std::complex< double > > & | , | ||
| const Parallel_Blkcyclic & | ) |
| void ModuleIO::output_after_relax | ( | bool | conv_ion, |
| bool | conv_esolver, | ||
| std::ofstream & | ofs_running ) |
output after relaxation
| conv_ion | if is convergence for ions |
| conv_esolver | if is convergence for electrons |
| ofs_running | the output stream |
| void ModuleIO::output_convergence_after_scf | ( | const bool & | convergence, |
| double & | energy, | ||
| std::ofstream & | ofs_running ) |
output if is convergence and energy after scf
| convergence | if is convergence |
| energy | the total energy in Ry |
| ofs_running | the output stream |
| void ModuleIO::output_dHR | ( | const int & | istep, |
| const ModuleBase::matrix & | v_eff, | ||
| const UnitCell & | ucell, | ||
| const Parallel_Orbitals & | pv, | ||
| LCAO_HS_Arrays & | HS_Arrays, | ||
| const Grid_Driver & | grid, | ||
| const TwoCenterBundle & | two_center_bundle, | ||
| const LCAO_Orbitals & | orb, | ||
| const MatROutputOptions & | options, | ||
| const bool | gamma_only_local, | ||
| const int | npol, | ||
| const int | nlocal, | ||
| std::ofstream & | ofs_running ) |
| void ModuleIO::output_dSR | ( | const int & | istep, |
| const UnitCell & | ucell, | ||
| const Parallel_Orbitals & | pv, | ||
| LCAO_HS_Arrays & | HS_Arrays, | ||
| const Grid_Driver & | grid, | ||
| const TwoCenterBundle & | two_center_bundle, | ||
| const LCAO_Orbitals & | orb, | ||
| const MatROutputOptions & | options, | ||
| const bool | gamma_only_local, | ||
| const int | npol, | ||
| const int | nlocal, | ||
| std::ofstream & | ofs_running ) |
| void ModuleIO::output_efermi | ( | const bool & | convergence, |
| const elecstate::Efermi & | eferm, | ||
| std::ofstream & | ofs_running ) |
output the fermi energy
| convergence | if is convergence |
| eferm | the fermi energy structure (supports single and two fermi energies) |
| ofs_running | the output stream |
| void ModuleIO::output_mat_npz | ( | const UnitCell & | ucell, |
| std::string & | zipname, | ||
| const hamilt::HContainer< double > & | hR ) |
| void ModuleIO::output_mat_npz | ( | const UnitCell & | ucell, |
| std::string & | zipname, | ||
| const hamilt::HContainer< std::complex< double > > & | hR ) |
| void ModuleIO::output_mat_npz_impl | ( | const UnitCell & | ucell, |
| std::string & | zipname, | ||
| const hamilt::HContainer< T > & | hR ) |
| void ModuleIO::output_mat_sparse | ( | const MatSparseOutputOptions & | options, |
| const int & | istep, | ||
| const ModuleBase::matrix & | v_eff, | ||
| const Parallel_Orbitals & | pv, | ||
| const TwoCenterBundle & | two_center_bundle, | ||
| const LCAO_Orbitals & | orb, | ||
| UnitCell & | ucell, | ||
| const Grid_Driver & | grid, | ||
| const K_Vectors & | kv, | ||
| hamilt::Hamilt< T > * | p_ham, | ||
| Plus_U_Base * | p_dftu, | ||
| const std::string & | global_out_dir, | ||
| const std::string & | global_matrix_dir, | ||
| const std::string & | calculation, | ||
| const int | out_app_flag, | ||
| const int | nspin, | ||
| const bool | gamma_only_local, | ||
| const int | npol, | ||
| const int | nlocal, | ||
| const bool | cal_force, | ||
| std::ofstream & | ofs_running ) |
the output interface to write the sparse matrix of dH, dS, T, and r
generate a file containing the kinetic energy matrix
generate a file containing the derivatives of the Hamiltonian matrix (in Ry/Bohr)
generate a file containing the derivatives of the overlap matrix (in 1/Bohr)
| template void ModuleIO::output_mat_sparse< double > | ( | const MatSparseOutputOptions & | options, |
| const int & | istep, | ||
| const ModuleBase::matrix & | v_eff, | ||
| const Parallel_Orbitals & | pv, | ||
| const TwoCenterBundle & | two_center_bundle, | ||
| const LCAO_Orbitals & | orb, | ||
| UnitCell & | ucell, | ||
| const Grid_Driver & | grid, | ||
| const K_Vectors & | kv, | ||
| hamilt::Hamilt< double > * | p_ham, | ||
| Plus_U_Base * | p_dftu, | ||
| const std::string & | global_out_dir, | ||
| const std::string & | global_matrix_dir, | ||
| const std::string & | calculation, | ||
| const int | out_app_flag, | ||
| const int | nspin, | ||
| const bool | gamma_only_local, | ||
| const int | npol, | ||
| const int | nlocal, | ||
| const bool | cal_force, | ||
| std::ofstream & | ofs_running ) |
| template void ModuleIO::output_mat_sparse< std::complex< double > > | ( | const MatSparseOutputOptions & | options, |
| const int & | istep, | ||
| const ModuleBase::matrix & | v_eff, | ||
| const Parallel_Orbitals & | pv, | ||
| const TwoCenterBundle & | two_center_bundle, | ||
| const LCAO_Orbitals & | orb, | ||
| UnitCell & | ucell, | ||
| const Grid_Driver & | grid, | ||
| const K_Vectors & | kv, | ||
| hamilt::Hamilt< std::complex< double > > * | p_ham, | ||
| Plus_U_Base * | p_dftu, | ||
| const std::string & | global_out_dir, | ||
| const std::string & | global_matrix_dir, | ||
| const std::string & | calculation, | ||
| const int | out_app_flag, | ||
| const int | nspin, | ||
| const bool | gamma_only_local, | ||
| const int | npol, | ||
| const int | nlocal, | ||
| const bool | cal_force, | ||
| std::ofstream & | ofs_running ) |
| void ModuleIO::output_SR | ( | const UnitCell & | ucell, |
| Parallel_Orbitals & | pv, | ||
| const Grid_Driver & | grid, | ||
| hamilt::Hamilt< TK > * | p_ham, | ||
| const bool & | binary, | ||
| const double & | sparse_threshold, | ||
| const int | precision, | ||
| const std::string & | global_matrix_dir, | ||
| const std::string & | calculation, | ||
| const int | out_app_flag, | ||
| const int | nspin, | ||
| const int | istep, | ||
| std::ofstream & | ofs_running ) |
| void ModuleIO::output_TR | ( | const int | istep, |
| const UnitCell & | ucell, | ||
| const Parallel_Orbitals & | pv, | ||
| LCAO_HS_Arrays & | HS_Arrays, | ||
| const Grid_Driver & | grid, | ||
| const TwoCenterBundle & | two_center_bundle, | ||
| const LCAO_Orbitals & | orb, | ||
| const std::string & | TR_filename, | ||
| const MatROutputOptions & | options, | ||
| std::ofstream & | ofs_running ) |
| void ModuleIO::output_vacuum_level | ( | const UnitCell * | ucell, |
| const double *const * | rho, | ||
| const double * | v_elecstat, | ||
| const int & | nx, | ||
| const int & | ny, | ||
| const int & | nz, | ||
| const int & | nxyz, | ||
| const int & | nrxx, | ||
| const int & | nplane, | ||
| const int & | startz_current, | ||
| std::ofstream & | ofs_running ) |
calculate and output the vacuum level We first determine the vacuum direction, then get the vacuum position based on the minimum of charge density, finally output the vacuum level, i.e., the electrostatic potential at the vacuum position.
| ucell | the unitcell |
| rho | charge density |
| v_elecstat | electrostatic potential |
| ofs_running | the output stream |
| void ModuleIO::parse_args | ( | int | argc, |
| char ** | argv ) |
This function returns the version information when using command "abacus --version", "abacus -v" or "abacus -V"; returns the compilation details when using command "abacus --info", "abacus -i" or "abacus -I"; otherwise, it returns usage.
| [in] | argc | (ARGument Count) is an integer variable that stores the number of command-line arguments passed by the user including the name of the program. So if we pass a value to a program, the value of argc would be 2 (one for argument and one for program name) |
| [in] | argv | (ARGument Vector) is an array of character pointers listing all the arguments. If argc is greater than zero, the array elements from argv[0] to argv[argc-1] will contain pointers to strings. argv[0] is the name of the program , After that till argv[argc-1] every element is command -line arguments. |
| AvailabilityExpr ModuleIO::parse_availability | ( | const std::string & | raw | ) |
Parse a canonical availability string into its boolean-expression tree.
The input must exactly match the AST serialization (param==value, param in [a, b], comparison operators, and/or combinators and (...) grouping). An empty string yields an empty (always-available) expression. Invalid or non-canonical input throws std::invalid_argument.
| CommandLineArgs ModuleIO::parse_command_line | ( | int | argc, |
| char * | argv[] ) |
Parses -p/–parameter and -in/–input options. Throws std::runtime_error on malformed arguments (parse_args has already filtered unknown flags before this function is called).
| bool ModuleIO::parse_imp_sol | ( | const std::string & | value, |
| int & | model, | ||
| std::string & | error ) |
| bool ModuleIO::parse_spreads | ( | const std::vector< std::string > & | words, |
| std::vector< double > & | spreads, | ||
| std::string & | error ) |
| void ModuleIO::prep_td_field_out | ( | const std::string & | output_dir, |
| const elecstate::TDFieldManager & | manager, | ||
| const bool | restart ) |
Prepare total endpoint E and, for analytic fields, the configured waveform files.
| void ModuleIO::prep_td_field_out | ( | const std::string & | output_dir, |
| std::size_t | field_count, | ||
| bool | restart ) |
Prepare electric-field output files for an RT-TDDFT calculation.
| output_dir | Output directory including its trailing path separator. |
| field_count | Number of configured time-dependent electric fields. |
| restart | Whether the calculation continues from an MD/RT-TDDFT restart. |
| void ModuleIO::prep_td_vecpot_out | ( | const std::string & | output_dir, |
| bool | restart ) |
Prepare the vector-potential output file for an RT-TDDFT calculation.
| output_dir | Output directory including its trailing path separator. |
| restart | Whether the calculation continues from an MD/RT-TDDFT restart. |
| void ModuleIO::prepare_dos | ( | std::ofstream & | ofs_running, |
| const elecstate::Efermi & | energy_fermi, | ||
| const ModuleBase::matrix & | ekb, | ||
| const int | nks, | ||
| const int | nbands, | ||
| const double & | dos_edelta_ev, | ||
| const double & | dos_scale, | ||
| double & | emax, | ||
| double & | emin, | ||
| const bool | dos_setemax, | ||
| const double | dos_emax_ev, | ||
| const bool | dos_setemin, | ||
| const double | dos_emin_ev, | ||
| const bool | two_fermi ) |
| void ModuleIO::print_build_info | ( | ) |
| void ModuleIO::print_conserv | ( | const pw::TDConserv & | values, |
| double | npsi0, | ||
| double | nrho0, | ||
| int | step, | ||
| bool | full_gram, | ||
| const std::string & | orth, | ||
| std::ofstream & | log ) |
Print endpoint conservation relative to the caller's initial counts.
| void ModuleIO::print_dipole_moment | ( | std::ofstream & | ofs_running, |
| const std::string & | name, | ||
| double | px, | ||
| double | py, | ||
| double | pz ) |
| void ModuleIO::print_eij | ( | const std::complex< double > * | eij, |
| const int | nband, | ||
| const int | leading_dimension, | ||
| const EijOutputInfo & | output_info, | ||
| std::ostream & | ofs ) |
Print selected elements of a column-major Hamiltonian in the orbital basis, in Ry.
| template void ModuleIO::print_eij_pw | ( | hsolver::HSOperator< std::complex< double >, base_device::DEVICE_CPU > & | , |
| hsolver::TDOrbOps< std::complex< double >, base_device::DEVICE_CPU > & | , | ||
| psi::Psi< std::complex< double >, base_device::DEVICE_CPU > & | , | ||
| const K_Vectors & | , | ||
| int | , | ||
| int | , | ||
| int | , | ||
| double | , | ||
| std::ostream & | ) |
| template void ModuleIO::print_eij_pw | ( | hsolver::HSOperator< std::complex< float >, base_device::DEVICE_CPU > & | , |
| hsolver::TDOrbOps< std::complex< float >, base_device::DEVICE_CPU > & | , | ||
| psi::Psi< std::complex< float >, base_device::DEVICE_CPU > & | , | ||
| const K_Vectors & | , | ||
| int | , | ||
| int | , | ||
| int | , | ||
| double | , | ||
| std::ostream & | ) |
| void ModuleIO::print_eij_pw | ( | hsolver::HSOperator< T, Device > & | op, |
| hsolver::TDOrbOps< T, Device > & | orbitals, | ||
| psi::Psi< T, Device > & | current, | ||
| const K_Vectors & | kv, | ||
| int | nspin, | ||
| int | step, | ||
| int | iter, | ||
| double | threshold, | ||
| std::ostream & | log ) |
Collect and print Eij from an already bound endpoint Hamiltonian. All ranks participate; both k-point cursors are restored before returning.
| void ModuleIO::print_force | ( | std::ofstream & | ofs, |
| const UnitCell & | cell, | ||
| const std::string & | name, | ||
| const ModuleBase::matrix & | force, | ||
| bool | ry = true ) |
output atomic forces
| ofs | the output stream |
| cell | the unitcell |
| name | force term name |
| force | atomic forces |
| ry | true if the unit of force is a.u. |
| void ModuleIO::print_help | ( | const std::string & | bin | ) |
Prints a short pointer to the canonical general help on standard error.
| void ModuleIO::print_kpar | ( | const int & | nks, |
| const int & | kpar_lcao ) |
| void ModuleIO::print_net_force | ( | std::ofstream & | ofs, |
| const ModuleBase::Vector3< double > & | net_force ) |
output the net force vector and the magnitude of the force drift
| ofs | the output stream |
| net_force | the sum of all atomic forces, in Ry/Bohr |
| void ModuleIO::print_PAOs | ( | const UnitCell & | ucell | ) |
print chi (PAO) in pseudopotential file
| ucell |
| void ModuleIO::print_parameters | ( | const UnitCell & | ucell, |
| K_Vectors & | kv, | ||
| const Input_para & | inp ) |
| void ModuleIO::print_rhofft | ( | ModulePW::PW_Basis * | pw_rhod, |
| ModulePW::PW_Basis * | pw_rho, | ||
| ModulePW::PW_Basis_Big * | pw_big, | ||
| std::ofstream & | ofs ) |
Print charge density using FFT.
| void ModuleIO::print_screen | ( | const int & | stress_step, |
| const int & | force_step, | ||
| const int & | istep ) |
| void ModuleIO::print_stress | ( | const std::string & | name, |
| const ModuleBase::matrix & | scs, | ||
| const bool | screen, | ||
| const bool | ry, | ||
| std::ofstream & | ofs ) |
output stress components
| name | stress term name |
| f | stress components |
| ry | true if the unit of force is a.u. |
| void ModuleIO::print_time | ( | time_t & | time_start, |
| time_t & | time_finish ) |
| void ModuleIO::print_wfcfft | ( | const Input_para & | inp, |
| ModulePW::PW_Basis_K & | pw_wfc, | ||
| std::ofstream & | ofs ) |
|
inline |
Inline provenance for formats such as Cube that reserve a fixed number of header lines. Callers append this to an existing comment line.
|
inline |
Two provenance lines followed by the unified "# Ionic_Step N" marker.
|
inline |
First two comment lines shared by per-step output files (band*.txt, wfk*_nao.txt, eband_*.txt, ...): "# ABACUS version: ..." and "# Written at ...". Callers append their own step/energy lines after this block.
| void ModuleIO::read_abacus_orb | ( | std::ifstream & | ifs, |
| std::string & | elem, | ||
| double & | ecut, | ||
| int & | nr, | ||
| double & | dr, | ||
| std::vector< int > & | nzeta, | ||
| std::vector< std::vector< double > > & | radials, | ||
| const int | rank = 0 ) |
static version of read_abacus_orb. A delete-new operation may cause the memory leak, it is better to use std::vector to replace the raw pointer.
| ifs | [in] ifstream from the orbital file, via std::ifstream ifs(forb); |
| elem | [out] element symbol |
| ecut | [out] planewave energy cutoff |
| nr | [out] number of radial grid points |
| dr | [out] radial grid spacing |
| nzeta | [out] number of zeta functions for each angular momentum |
| radials | [out] radial orbitals |
| rank | [in] MPI rank |
| bool ModuleIO::read_cube | ( | const std::string & | file, |
| std::vector< std::string > & | comment, | ||
| int & | natom, | ||
| std::vector< double > & | origin, | ||
| int & | nx, | ||
| int & | ny, | ||
| int & | nz, | ||
| std::vector< double > & | dx, | ||
| std::vector< double > & | dy, | ||
| std::vector< double > & | dz, | ||
| std::vector< int > & | atom_type, | ||
| std::vector< double > & | atom_charge, | ||
| std::vector< std::vector< double > > & | atom_pos, | ||
| std::vector< double > & | data ) |
read the full data from a cube file
| bool ModuleIO::read_dmk | ( | const int | nspin, |
| const int | nk, | ||
| const K_Vectors & | kv, | ||
| const Parallel_Blkcyclic & | pv, | ||
| const bool | column_major, | ||
| const std::string & | dmk_dir, | ||
| const int | istep, | ||
| const int | out_app_flag, | ||
| std::vector< std::vector< T > > & | dmk, | ||
| std::ofstream & | ofs_running ) |
Reads the DMK data from a file.
| T | The type of the DMK data. |
| nspin | The number of spin components. |
| nk | The number of k-points. |
| k-vector | information. |
| pv | The Parallel_Blkcyclic object. Will get the global size and local size from it, and seperate the data into different processors accordingly. |
| column_major | Whether the local DMK blocks must be stored column-major (genelpa/elpa/scalapack_gvx and the other column-major solvers). The file body is row-major, so this selects the destination index of each element. |
| dmk_dir | The directory path of the DMK file. |
| istep | The ionic step to read. With out_app_flag == 1 it selects the frame of the appended multi-step file, and a negative value keeps the first frame; with out_app_flag == 2 it has to match the g{istep+1} file name and the frame marker it contains. |
| out_app_flag | Must mirror the value used by write_dmk, because it decides whether the step is part of the filename. |
| dmk | A vector to store the DMK data. If use MPI parallel, the data will be seperated into different processors based on the Parallel_Blkcyclic object. |
| int ModuleIO::read_exit_file | ( | const int & | my_rank, |
| const std::string & | filename, | ||
| std::ofstream & | ofs_running ) |
read file to determine whether to stop the current execution
| my_rank | the rank of the current process |
| filename | the name of the file to read |
| ofs_running | the output stream |
| void ModuleIO::read_Hexxs_cereal | ( | const std::string & | file_name, |
| std::vector< std::map< int, std::map< TAC, RI::Tensor< Tdata > > > > & | Hexxs ) |
read Hexxs in cereal format
| template void ModuleIO::read_Hexxs_cereal< double > | ( | const std::string & | , |
| std::vector< std::map< int, std::map< TAC, RI::Tensor< double > > > > & | ) |
| template void ModuleIO::read_Hexxs_cereal< std::complex< double > > | ( | const std::string & | , |
| std::vector< std::map< int, std::map< TAC, RI::Tensor< std::complex< double > > > > > & | ) |
| void ModuleIO::read_Hexxs_csr | ( | const std::string & | file_name, |
| const UnitCell & | ucell, | ||
| const int | nspin, | ||
| const int | nbasis, | ||
| std::vector< std::map< int, std::map< TAC, RI::Tensor< Tdata > > > > & | Hexxs ) |
read Hexxs in CSR format
| template void ModuleIO::read_Hexxs_csr< double > | ( | const std::string & | , |
| const UnitCell & | , | ||
| const int | , | ||
| const int | , | ||
| std::vector< std::map< int, std::map< TAC, RI::Tensor< double > > > > & | ) |
| template void ModuleIO::read_Hexxs_csr< std::complex< double > > | ( | const std::string & | , |
| const UnitCell & | , | ||
| const int | , | ||
| const int | , | ||
| std::vector< std::map< int, std::map< TAC, RI::Tensor< std::complex< double > > > > > & | ) |
| void ModuleIO::read_information | ( | std::stringstream & | ifs, |
| std::vector< std::string > & | output, | ||
| const std::string & | delimiters ) |
| std::vector< double > ModuleIO::read_k | ( | std::string | filename, |
| int | ik ) |
| void ModuleIO::read_mat_npz | ( | const Parallel_Orbitals * | paraV, |
| const UnitCell & | ucell, | ||
| std::string & | zipname, | ||
| hamilt::HContainer< double > & | hR ) |
| std::vector< ModuleBase::Vector3< double > > ModuleIO::read_td_vecpot | ( | const std::string & | input_dir | ) |
Read Cartesian vector potentials for an RT-TDDFT calculation.
| input_dir | Input directory including its trailing path separator. |
| bool ModuleIO::read_vdata_palgrid | ( | const Parallel_Grid & | pgrid, |
| const int | my_rank, | ||
| std::ostream & | ofs_running, | ||
| const std::string & | fn, | ||
| double *const | data, | ||
| const int | nat ) |
read volumetric data from .cube file into the parallel distributed grid.
| void ModuleIO::read_wf2rho_pw | ( | const ModulePW::PW_Basis_K * | pw_wfc, |
| ModuleSymmetry::Symmetry & | symm, | ||
| Charge & | chg, | ||
| const std::string & | readin_dir, | ||
| const int | kpar, | ||
| const int | my_pool, | ||
| const int | my_rank, | ||
| const int | nproc_in_pool, | ||
| const int | rank_in_pool, | ||
| const int | nbands, | ||
| const int | nspin, | ||
| const int | npol, | ||
| const int | nkstot, | ||
| const std::vector< int > & | ik2iktot, | ||
| const std::vector< int > & | isk, | ||
| std::ofstream & | ofs_running ) |
read wave functions and occupation numbers to charge density
| pw_wfc | pw basis for wave functions |
| symm | symmetry |
| nkstot | total number of k points |
| isk | k index to spin index |
| chg | charge density |
| void ModuleIO::read_wf2rho_pw_impl | ( | const ModulePW::PW_Basis_K * | pw_wfc, |
| ModuleSymmetry::Symmetry & | symm, | ||
| Charge & | chg, | ||
| const std::string & | readin_dir, | ||
| const int | kpar, | ||
| const int | my_pool, | ||
| const int | my_rank, | ||
| const int | nproc_in_pool, | ||
| const int | rank_in_pool, | ||
| const int | nbands, | ||
| const int | nspin, | ||
| const int | npol, | ||
| const int | nkstot, | ||
| const std::vector< int > & | ik2iktot, | ||
| const std::vector< int > & | isk, | ||
| std::ofstream & | ofs_running ) |
| bool ModuleIO::read_wfc_nao | ( | const std::string & | global_readin_dir, |
| const Parallel_Orbitals & | ParaV, | ||
| psi::Psi< T > & | psid, | ||
| ModuleBase::matrix & | ekb, | ||
| ModuleBase::matrix & | wg, | ||
| const std::vector< int > & | ik2iktot, | ||
| const int | nkstot, | ||
| const int | nspin, | ||
| const bool | binary, | ||
| const int | skip_band = 0, | ||
| const int | istep = -1 ) |
Reads the wavefunction coefficients from an input file.
| T | The type of the wavefunction coefficients. |
| global_readin_dir | The global directory for reading input files. |
| ParaV | The parallel orbitals object. |
| psid | The Psi object to store the wavefunction coefficients. |
| pelec | Pointer to the ElecState object. |
| binary | Whether to read the binary format instead of the text format. |
| skip_band | From which band to start reading. |
| void ModuleIO::read_wfc_nao_one_data | ( | std::ifstream & | ifs, |
| double & | data ) |
| void ModuleIO::read_wfc_nao_one_data | ( | std::ifstream & | ifs, |
| float & | data ) |
Reads a single data value from an input file stream.
| ifs | The input file stream to read from. |
| data | The variable to store the read data value. |
| void ModuleIO::read_wfc_nao_one_data | ( | std::ifstream & | ifs, |
| std::complex< double > & | data ) |
| void ModuleIO::read_wfc_nao_one_data | ( | std::ifstream & | ifs, |
| std::complex< float > & | data ) |
Reads a single complex data value from an input file stream.
| ifs | The input file stream to read from. |
| data | The variable to store the read complex data value. |
| bool ModuleIO::read_wfc_nao_spin_populations | ( | const std::string & | readin_dir, |
| int | nkstot, | ||
| int | nspin, | ||
| bool | gamma_only, | ||
| bool | binary, | ||
| int | my_rank, | ||
| std::vector< double > & | populations ) |
Read spin populations from all bands, without allocating wavefunction matrices. File occupations are already weighted by their k-point weights.
| void ModuleIO::read_wfc_pw | ( | const std::string & | filedir, |
| const ModulePW::PW_Basis_K * | pw_wfc, | ||
| const int | rank_in_pool, | ||
| const int | nproc_in_pool, | ||
| const int | nbands, | ||
| const int | npol, | ||
| const int & | ik, | ||
| const int & | ikstot, | ||
| const int & | nkstot, | ||
| ModuleBase::ComplexMatrix & | wfc ) |
read wave functions from binary file
| filename | filename containing wave functions |
| pw_wfc | wave function FFT grids |
| ik | k index |
| ikstot | total index of k points |
| nkstot | total number of k points |
| wfc | wave functions |
| int ModuleIO::run_control_option_size | ( | int | argc, |
| char * | argv[], | ||
| int | index ) |
Number of tokens occupied by one run-control option, including its values. Returns zero for other options; throws std::runtime_error for missing values.
| void ModuleIO::save_dH_sparse | ( | const int & | istep, |
| const Parallel_Orbitals & | pv, | ||
| const UnitCell * | ucell, | ||
| LCAO_HS_Arrays & | HS_Arrays, | ||
| const double & | sparse_thr, | ||
| const bool & | binary, | ||
| const std::string & | fileflag, | ||
| const int | precision, | ||
| const std::string & | global_matrix_dir, | ||
| const std::string & | calculation, | ||
| const int | out_app_flag, | ||
| const int | nspin, | ||
| const int | nlocal, | ||
| std::ofstream & | ofs_running ) |
| void ModuleIO::save_lat_r | ( | std::ofstream & | ofs, |
| const SparseRBlock< T > & | XR, | ||
| const Parallel_Blkcyclic & | layout, | ||
| const SparseWriteOptions & | options ) |
| void ModuleIO::save_lat_r_csr | ( | std::ofstream & | ofs, |
| const SparseRBlock< T > & | XR, | ||
| const Parallel_Blkcyclic & | layout, | ||
| const SparseWriteOptions & | options ) |
Write one R block in the H(R)/S(R)/r(R) CSR text layout.
The block is reduced across ranks exactly like save_lat_r, then printed through SparseMatrix so that values wrap every six entries and an empty block still carries its three CSR sections. Only the root rank opens the output stream, so ofs.is_open() selects the rank that owns the assembled matrix and performs the printing; every rank still takes part in the collective reduction.
| ofs | Output text stream. |
| XR | Sparse block of the selected matrix component. |
| layout | Block-cyclic distribution used for the MPI reduction. |
| options | Sparse output options (threshold, precision, reduction). |
| template void ModuleIO::save_lat_r_empty_csr< double > | ( | std::ofstream & | ofs, |
| int | nlocal, | ||
| const SparseWriteOptions & | options ) |
Write an all-zero R block in the H(R)/S(R)/r(R) CSR text layout.
Callers that already know a block is globally empty (for example from an allreduced nonzero count) use this instead of save_lat_r_csr to skip its row-wise MPI reductions. The emitted bytes are identical to save_lat_r_csr on an empty block: an empty SparseMatrix printed on the rank that owns the stream.
| ofs | Output text stream. |
| nlocal | Number of localized basis functions. |
| options | Sparse output options (precision and reduce flag). |
| void ModuleIO::save_mat | ( | const int | istep, |
| const T * | mat, | ||
| const int | dim, | ||
| const bool | bit, | ||
| const int | precision, | ||
| const bool | tri, | ||
| const bool | app, | ||
| const std::string & | file_name, | ||
| const Parallel_Blkcyclic & | pv, | ||
| const int | drank, | ||
| const std::string & | ks_solver, | ||
| const bool | reduce = true ) |
save a square matrix, such as H(k) and S(k)
| [in] | istep | : the step of the calculation |
| [in] | mat | : the local matrix |
| [in] | dim | : the dimension of the square matrix |
| [in] | bit | : true for binary, false for decimal |
| [in] | precision | : the precision of the decimal output |
| [in] | tri | : true for upper triangle, false for full matrix |
| [in] | app | : true for append, false for overwrite |
| [in] | file_name | : the name of the output file |
| [in] | pv | : the 2d-block parallelization information |
| [in] | drank | : the rank of the current process in the diagonalization world |
| [in] | ks_solver | : the name of the eigensolver (decides row/column major) |
| [in] | reduce | : whether to reduce across ranks before writing |
| void ModuleIO::save_sparse | ( | const SparseRMatrix< Tdata > & | smat, |
| const std::set< RCoordinate > & | all_R_coor, | ||
| const Parallel_Orbitals & | pv, | ||
| const SparseWriteOptions & | options ) |
| void ModuleIO::set_para2d_MO | ( | const Parallel_Orbitals & | pv, |
| const int | nbands, | ||
| Parallel_Blkcyclic & | p2d ) |
Set up a 2D parallel distribution for MO-space matrices (nbands x nbands).
| pv | Parallel_Orbitals describing the AO distribution |
| nbands | Number of bands |
| p2d | Output Parallel_Blkcyclic object |
| std::string ModuleIO::sr_gen_fname | ( | const bool | numbered, |
| const int | istep ) |
Generate filename for spin-independent SR output.
| std::string ModuleIO::sr_gen_fname | ( | const bool | numbered, |
| const int | istep, | ||
| const int | out_type ) |
Generate filename for spin-independent SR output in the selected format.
| void ModuleIO::stm_mode_pw | ( | const elecstate::ElecStatePW< std::complex< double > > * | pelec, |
| const psi::Psi< std::complex< double >, Device > & | psi, | ||
| const Device * | ctx, | ||
| const Parallel_Grid & | pgrid, | ||
| const UnitCell & | ucell, | ||
| const std::vector< double > & | stm_bias, | ||
| const int | nspin, | ||
| const int | istep, | ||
| const std::string & | global_out_dir, | ||
| const bool | two_fermi, | ||
| const int | out_ldos_precision, | ||
| std::ofstream & | ofs_running ) |
|
inline |
Fixed STRU for overwrite/append modes; numbered STRU for mode 2.
| ModuleIO::TEST | ( | AvailabilityParser | , |
| AndGroup | ) |
| ModuleIO::TEST | ( | AvailabilityParser | , |
| EmptyIsAlwaysAvailable | ) |
| ModuleIO::TEST | ( | AvailabilityParser | , |
| InListRoundTrip | ) |
| ModuleIO::TEST | ( | AvailabilityParser | , |
| InvalidExpressionsAreRejected | ) |
| ModuleIO::TEST | ( | AvailabilityParser | , |
| LeafEqualityRoundTrip | ) |
| ModuleIO::TEST | ( | AvailabilityParser | , |
| NonCanonicalSpellingIsRejected | ) |
| ModuleIO::TEST | ( | AvailabilityParser | , |
| ParenthesisedOrNesting | ) |
| ModuleIO::TEST | ( | AvailabilityParser | , |
| QuotedMultiTokenValueRoundTrip | ) |
| ModuleIO::TEST | ( | AvailabilityParser | , |
| SetterPreservesStateOnParseFailure | ) |
| ModuleIO::TEST | ( | AvailabilityParser | , |
| SlashRemainsPartOfSingleEqualityValue | ) |
| ModuleIO::TEST | ( | AvailabilityParser | , |
| VectorContainmentSemantics | ) |
| ModuleIO::TEST | ( | AvailabilityValidator | , |
| AcceptsDependenciesOfDependencies | ) |
| ModuleIO::TEST | ( | AvailabilityValidator | , |
| AcceptsKnownTypedReferences | ) |
| ModuleIO::TEST | ( | AvailabilityValidator | , |
| AcceptsOrPrerequisiteImpliedByPath | ) |
| ModuleIO::TEST | ( | AvailabilityValidator | , |
| ChecksPrerequisitesTransitivelyThroughOr | ) |
| ModuleIO::TEST | ( | AvailabilityValidator | , |
| InfersDocumentedTypes | ) |
| ModuleIO::TEST | ( | AvailabilityValidator | , |
| RejectsMissingTransitiveRequirement | ) |
| ModuleIO::TEST | ( | AvailabilityValidator | , |
| RejectsSelfReference | ) |
| ModuleIO::TEST | ( | AvailabilityValidator | , |
| RejectsUnknownAndIncompatibleReferences | ) |
| ModuleIO::TEST | ( | AvailabilityValidator | , |
| RequiresExactNonEqualityPrerequisite | ) |
| std::string ModuleIO::to_dir | ( | const std::string & | str | ) |
| void ModuleIO::trilinear_interpolate | ( | const double *const | data_in, |
| const int & | nx_read, | ||
| const int & | ny_read, | ||
| const int & | nz_read, | ||
| const int & | nx, | ||
| const int & | ny, | ||
| const int & | nz, | ||
| double * | data_out ) |
The trilinear interpolation method.
Trilinear interpolation is a method for interpolating grid data in 3D space. It estimates the value at a given position by interpolating the data along the three adjacent points.
Specifically, for 3D grid data, trilinear interpolation requires determining the eight data points that are closest to the point where the estimation is required. These data points form a cube, with vertices at (x0,y0,z0), (x0+1,y0,z0), (x0,y0+1,z0), (x0+1,y0+1,z0), (x0,y0,z0+1), (x0+1,y0,z0+1), (x0,y0+1,z0+1) and (x0+1,y0+1,z0+1). Here, (x0,y0,z0) is the data point closest to the estimation point and has coordinate values less than those of the estimation point.
For the estimation location (x,y,z), its estimated value in the grid can be calculated using the following formula: f(x,y,z) = f000(1-dx)(1-dy)(1-dz) + f100dx(1-dy)(1-dz) + f010(1-dx)dy(1-dz) + f001(1-dx)(1-dy)dz + f101dx(1-dy)dz + f011(1-dx)dydz + f110dxdy(1-dz) + f111dxdydz where fijk represents the data value at vertex i,j,k of the cube, and dx = x - x0, dy = y - y0, dz = z - z0 represent the distance between the estimation point and the closest data point in each of the three directions, divided by the grid spacing. Here, it is assumed that the grid spacing is equal and can be omitted during computation.
| data_in | the input data of size nxyz_read |
| nx_read | nx read from file |
| ny_read | ny read from file |
| nz_read | nz read from file |
| nx | the dimension of grids along x |
| ny | the dimension of grids along y |
| nz | the dimension of grids along z |
| data_out | the interpolated results of size nxyz |
| void ModuleIO::trilinear_interpolate | ( | const std::vector< std::vector< int > > & | points, |
| const std::vector< std::vector< double > > & | shifts, | ||
| const Parallel_Grid & | pgrid, | ||
| const std::vector< double > & | data, | ||
| std::vector< double > & | results ) |
| void ModuleIO::validate_availability_expr | ( | const std::string & | owner, |
| const AvailabilityExpr & | expression, | ||
| const std::map< std::string, AvailabilityValueKind > & | parameter_types ) |
Validate references, operators and literal values in one availability AST. Throws std::invalid_argument when metadata cannot be evaluated safely.
| void ModuleIO::validate_availability_self_contained | ( | const std::string & | owner, |
| const AvailabilityExpr & | expression, | ||
| const std::map< std::string, AvailabilityExpr > & | expressions ) |
Validate that each path referencing a parameter implies that parameter's availability AST. Associative AND/OR groups are flattened and order-independent; AND prerequisites require every operand, while any satisfied OR branch is sufficient. Different leaf conditions are not related. expressions maps every parameter label to its availability AST. Throws std::invalid_argument when a referenced parameter's prerequisite is missing.
| void ModuleIO::wfc_nao_write2file | ( | const std::string & | name, |
| const double * | ctot, | ||
| const int | nlocal, | ||
| const int | ik, | ||
| const ModuleBase::matrix & | ekb, | ||
| const ModuleBase::matrix & | wg, | ||
| const bool & | writeBinary, | ||
| const bool & | append_flag, | ||
| const std::string & | header ) |
write real-valued Gamma-only wavefunction coefficients to a file.
| name | output file name |
| ctot | global wavefunction coefficient array, size nbands*nlocal |
| nlocal | number of orbitals (basis functions) |
| ik | local k-point index, used to index ekb/wg rows |
| ekb | eigenvalue matrix |
| wg | occupation matrix |
| writeBinary | true for the binary format, false for text |
| append_flag | true to append to an existing file, false to truncate |
| header | provenance comment block written before the data in text mode; ignored in binary mode |
| void ModuleIO::wfc_nao_write2file_complex | ( | const std::string & | name, |
| const std::complex< double > * | ctot, | ||
| const int | nlocal, | ||
| const int & | ik, | ||
| const ModuleBase::Vector3< double > & | kvec_c, | ||
| const ModuleBase::matrix & | ekb, | ||
| const ModuleBase::matrix & | wg, | ||
| const bool & | writeBinary, | ||
| const bool & | append_flag, | ||
| const std::string & | header ) |
write complex wavefunction coefficients to a file.
| name | output file name |
| ctot | global wavefunction coefficient array, size nbands*nlocal |
| nlocal | number of orbitals (basis functions) |
| ik | local k-point index, used to index ekb/wg rows |
| kvec_c | Cartesian k-vector of the k-point |
| ekb | eigenvalue matrix |
| wg | occupation matrix |
| writeBinary | true for the binary format, false for text |
| append_flag | true to append to an existing file, false to truncate |
| header | provenance comment block written before the data in text mode; ignored in binary mode |
| void ModuleIO::write_abacus_orb | ( | std::ofstream & | ofs, |
| const std::string & | elem, | ||
| const double & | ecut, | ||
| const int | nr, | ||
| const double | dr, | ||
| const std::vector< int > & | nzeta, | ||
| const std::vector< std::vector< double > > & | radials, | ||
| const int | rank = 0 ) |
| void ModuleIO::write_bands | ( | const Input_para & | inp, |
| const ModuleBase::matrix & | ekb, | ||
| const K_Vectors & | kv, | ||
| std::ofstream & | ofs_running, | ||
| const std::string & | band_dir, | ||
| const int | istep ) |
write the eigenvalues of every spin channel to band.txt (nspin=1/4) or to bands1.txt/bands2.txt (nspin=2).
| inp | input parameters, out_band[0] enables the output and out_band[1] sets the number of printed decimals |
| ekb | eigenvalues of k points and bands |
| kv | klist |
| ofs_running | running log stream |
| band_dir | directory that receives the band output files; the caller resolves it from the output directory configuration |
| istep | zero-based index of the current ionic step, printed one-based in the per-step provenance header |
| void ModuleIO::write_chg_init | ( | const UnitCell & | ucell, |
| const Parallel_Grid & | para_grid, | ||
| const Charge & | chr, | ||
| const elecstate::Efermi & | efermi, | ||
| const int | istep, | ||
| const std::string & | out_dir, | ||
| const Input_para & | inp, | ||
| const bool | two_fermi, | ||
| std::ofstream & | ofs_running ) |
| void ModuleIO::write_csr_banner | ( | std::ostream & | ofs | ) |
Write the CSR-format description banner used by every text CSR output (H(R)/S(R), DM(R), dH/dR, r(R), T(R), Vxc(R), L(R)).
| ofs | Output stream. |
| void ModuleIO::write_cube | ( | const std::string & | file, |
| const std::vector< std::string > & | comment, | ||
| const int & | natom, | ||
| const std::vector< double > & | origin, | ||
| const int & | nx, | ||
| const int & | ny, | ||
| const int & | nz, | ||
| const std::vector< double > & | dx, | ||
| const std::vector< double > & | dy, | ||
| const std::vector< double > & | dz, | ||
| const std::vector< int > & | atom_type, | ||
| const std::vector< double > & | atom_charge, | ||
| const std::vector< std::vector< double > > & | atom_pos, | ||
| const std::vector< double > & | data, | ||
| const int | precision, | ||
| const bool | append, | ||
| const int | ndata_line = 6 ) |
write a cube file
| append | append a complete frame to an existing file instead of truncating it (out_app_flag == 1 multi-step trajectories). |
| void ModuleIO::write_cube_header | ( | std::ofstream & | ofs, |
| const std::vector< std::string > & | comment, | ||
| const int & | natom, | ||
| const std::vector< double > & | origin, | ||
| const int & | nx, | ||
| const int & | ny, | ||
| const int & | nz, | ||
| const std::vector< double > & | dx, | ||
| const std::vector< double > & | dy, | ||
| const std::vector< double > & | dz, | ||
| const std::vector< int > & | atom_type, | ||
| const std::vector< double > & | atom_charge, | ||
| const std::vector< std::vector< double > > & | atom_pos, | ||
| const int | precision ) |
write the two comment lines, the grid geometry and the atom list of a cube file, and leave the stream configured for the following scientific data block
| void ModuleIO::write_cube_header_for_cell | ( | std::ofstream & | ofs, |
| const UnitCell & | ucell, | ||
| const int | nx, | ||
| const int | ny, | ||
| const int | nz, | ||
| const std::vector< std::string > & | comment, | ||
| const int | precision ) |
write a cube header for a volumetric field sampled on the ucell grid (grid spacings, atom types and Cartesian positions are derived from ucell)
| void ModuleIO::write_current_pw | ( | const pw::TDVelResultPW & | current, |
| const int | istep, | ||
| const int | nk_per_spin, | ||
| const bool | out_current_k, | ||
| const std::string & | out_dir ) |
Write reduced charge currents on the output rank; performs no collectives.
| void ModuleIO::write_dense_text_body | ( | std::ofstream & | ofs, |
| const std::vector< double > & | mat, | ||
| const int | nlocal, | ||
| const int | precision, | ||
| const bool | column_major ) |
Write a dense square matrix body in the flat NAO text layout shared by the DM(k), H(k)/S(k) and T(k) writers.
The documented file layout is row-major: element (i, j) is emitted at position (i * nlocal + j), 8 real or 4 complex values per line, and the record is terminated by a single newline so that an appended record starts on a fresh line.
The gathered buffer keeps the storage order of the eigensolver. For the column-major solvers (genelpa, elpa, scalapack_gvx, cusolver, cusolvermp, pexsi and lapack) the local block is stored as mat[i + j * nrloc], so the row-major destination of Cpxgemr2d keeps a column-major buffer. Reading such a buffer as row-major emits the transpose of the matrix; for a Hermitian matrix that is the complex conjugate, which flips the sign of every imaginary off-diagonal element. The caller selects the traversal order with column_major so the file always stays row-major.
| [in] | ofs | output stream, already open by the writing rank |
| [in] | mat | gathered nlocal-by-nlocal matrix on the writing rank |
| [in] | nlocal | matrix dimension, must be positive |
| [in] | precision | number of significant digits, must be positive |
| [in] | column_major | true when the gathered buffer is stored column-major |
| void ModuleIO::write_dense_text_body | ( | std::ofstream & | ofs, |
| const std::vector< std::complex< double > > & | mat, | ||
| const int | nlocal, | ||
| const int | precision, | ||
| const bool | column_major ) |
Complex overload of write_dense_text_body.
Real and imaginary components whose magnitude is below an internal threshold are flushed to zero so that numerical noise does not clutter the output.
| [in] | ofs | output stream, already open by the writing rank |
| [in] | mat | gathered nlocal-by-nlocal matrix on the writing rank |
| [in] | nlocal | matrix dimension, must be positive |
| [in] | precision | number of significant digits, must be positive |
| [in] | column_major | true when the gathered buffer is stored column-major |
| void ModuleIO::write_dH_components | ( | WriteDHParams & | params, |
| const Exx_Info & | exx_info ) |
| void ModuleIO::write_dh_perI | ( | WriteDHParams & | params, |
| int | ispin, | ||
| const std::string & | rprefix, | ||
| const std::string & | kprefix, | ||
| const std::string & | label, | ||
| const std::string & | term_name, | ||
| std::array< std::vector< hamilt::HContainer< double > * >, 3 > & | g, | ||
| const std::vector< int > & | atom_filter ) |
| bool ModuleIO::write_dH_sum | ( | WriteDHParams & | params | ) |
| bool ModuleIO::write_dH_t | ( | WriteDHParams & | params | ) |
| bool ModuleIO::write_dH_vh | ( | WriteDHParams & | params | ) |
| bool ModuleIO::write_dH_vh_pulay | ( | WriteDHParams & | params | ) |
| bool ModuleIO::write_dH_vl | ( | WriteDHParams & | params | ) |
| bool ModuleIO::write_dH_vnl | ( | WriteDHParams & | params | ) |
| bool ModuleIO::write_dH_vxc | ( | WriteDHParams & | params | ) |
| bool ModuleIO::write_dH_vxc_pulay | ( | WriteDHParams & | params | ) |
| void ModuleIO::write_dipole | ( | const UnitCell & | ucell, |
| const double * | rho, | ||
| const ModulePW::PW_Basis * | rhopw, | ||
| const int & | istep, | ||
| const std::string & | fn, | ||
| std::ofstream & | ofs_running, | ||
| const int & | precision = 13 ) |
Write aligned electronic dipoles; precision counts significant digits.
| void ModuleIO::write_dmk | ( | const std::vector< std::vector< T > > & | dmk, |
| const K_Vectors & | kv, | ||
| const int | precision, | ||
| const std::vector< double > & | efs, | ||
| const UnitCell * | ucell, | ||
| const Parallel_Blkcyclic & | pv, | ||
| const bool | column_major, | ||
| const std::string & | dmk_dir, | ||
| const int | istep, | ||
| const int | out_app_flag, | ||
| std::ofstream & | ofs_running ) |
Writes the DMK data to a file.
The written matrix element is D(i,j) = sum_n w_n * conj(c_n,i) * c_n,j (complex conjugate on the first band index), matching the convention built by dm_from_psi; this is the complex conjugate of the physical one-body density matrix sum_n w_n c_n,i conj(c_n,j). The same line is also emitted as a '#' comment in the file header.
| T | The type of the DMK data. |
| dmk | A vector containing the DMK data. The first dimension is nspin*nk, and the second dimension is nlocal*nlocal. DMK is parallel in 2d-block type if using MPI. |
| k-vector | information. |
| precision | The precision of the output of DMK. |
| efs | A vector containing the Fermi energies, and should have the same size as the number of SPIN. |
| ucell | A pointer to the UnitCell object. |
| pv | The Parallel_Blkcyclic object. The 2d-block parallel information of DMK. |
| column_major | Whether the local DMK blocks are stored column-major (genelpa/elpa/scalapack_gvx and the other column-major solvers). The file body is always row-major, so this selects the traversal order. |
| dmk_dir | The directory the DMK files are written into. |
| out_app_flag | Append-mode selector: 1 reuses the fixed filename across ionic steps and appends a new record per step in multi-step runs (MD or relax), 0 or 2 inserts the geometry-step index g{N}. |
| void ModuleIO::write_dmr | ( | const std::vector< hamilt::HContainer< double > * > | dmr, |
| const UnitCell * | ucell, | ||
| const int | precision, | ||
| const Parallel_Blkcyclic & | paraV, | ||
| const int | out_app_flag, | ||
| const int * | iat2iwt, | ||
| const int | nat, | ||
| const std::string & | dmr_dir, | ||
| const int | istep, | ||
| std::ofstream & | ofs_running ) |
Writes DMR to a file.
| dmr | The 2D block parallel matrix representing the density matrix. The first dimension is the spin index. |
| ucell | stands for unitcell |
| precision | Control the output precision |
| paraV | The parallel 2D object. |
| out_app_flag | Output mode: 0 = fixed filename, overwritten at every write; 1 = fixed filename, appended; 2 = per-step g{step} filename. |
| iat2iwt | The mapping from atom index to the first local orbital index. |
| nat | The number of atoms. |
| dmr_dir | The directory the DM(R) files are written into. |
| istep | The ION step, starting from 0. |
| void ModuleIO::write_dmr_csr | ( | std::string & | fname, |
| const UnitCell * | ucell, | ||
| const int | precision, | ||
| hamilt::HContainer< double > * | dm_serial, | ||
| const int | istep, | ||
| const int | ispin, | ||
| const int | nspin, | ||
| const bool | append ) |
Writes HContainer to a csr file.
| fname | The name of the file to write the CSR representation to. |
| ucell | stands for unitcell |
| precision | Control the ouptut precision |
| dm_serial | A pointer to the Hamiltonian container. |
| istep | The current step number. |
| append | Whether to append to the existing file. The first written step (istep <= 0) always truncates. |
| template void ModuleIO::write_dos_lcao | ( | const psi::Psi< double > * | psi, |
| hamilt::Hamilt< double > * | p_ham, | ||
| const Parallel_Orbitals & | pv, | ||
| const UnitCell & | ucell, | ||
| const K_Vectors & | kv, | ||
| const int | nbands, | ||
| const elecstate::Efermi & | energy_fermi, | ||
| const ModuleBase::matrix & | ekb, | ||
| const ModuleBase::matrix & | wg, | ||
| const double & | dos_edelta_ev, | ||
| const double & | dos_scale, | ||
| const double & | bcoeff, | ||
| const int | out_dos, | ||
| const int | out_app_flag, | ||
| const int | precision, | ||
| const int | istep, | ||
| const int | nspin, | ||
| const int | nlocal, | ||
| const bool | dos_setemax, | ||
| const double | dos_emax_ev, | ||
| const bool | dos_setemin, | ||
| const double | dos_emin_ev, | ||
| const bool | two_fermi, | ||
| const int | bndpar, | ||
| const std::string & | global_out_dir, | ||
| std::ofstream & | ofs_running ) |
| template void ModuleIO::write_dos_lcao | ( | const psi::Psi< std::complex< double > > * | psi, |
| hamilt::Hamilt< std::complex< double > > * | p_ham, | ||
| const Parallel_Orbitals & | pv, | ||
| const UnitCell & | ucell, | ||
| const K_Vectors & | kv, | ||
| const int | nbands, | ||
| const elecstate::Efermi & | energy_fermi, | ||
| const ModuleBase::matrix & | ekb, | ||
| const ModuleBase::matrix & | wg, | ||
| const double & | dos_edelta_ev, | ||
| const double & | dos_scale, | ||
| const double & | bcoeff, | ||
| const int | out_dos, | ||
| const int | out_app_flag, | ||
| const int | precision, | ||
| const int | istep, | ||
| const int | nspin, | ||
| const int | nlocal, | ||
| const bool | dos_setemax, | ||
| const double | dos_emax_ev, | ||
| const bool | dos_setemin, | ||
| const double | dos_emin_ev, | ||
| const bool | two_fermi, | ||
| const int | bndpar, | ||
| const std::string & | global_out_dir, | ||
| std::ofstream & | ofs_running ) |
| void ModuleIO::write_dos_lcao | ( | const psi::Psi< T > * | psi, |
| hamilt::Hamilt< T > * | p_ham, | ||
| const Parallel_Orbitals & | pv, | ||
| const UnitCell & | ucell, | ||
| const K_Vectors & | kv, | ||
| const int | nbands, | ||
| const elecstate::Efermi & | energy_fermi, | ||
| const ModuleBase::matrix & | ekb, | ||
| const ModuleBase::matrix & | wg, | ||
| const double & | dos_edelta_ev, | ||
| const double & | dos_scale, | ||
| const double & | bcoeff, | ||
| const int | out_dos, | ||
| const int | out_app_flag, | ||
| const int | precision, | ||
| const int | istep, | ||
| const int | nspin, | ||
| const int | nlocal, | ||
| const bool | dos_setemax, | ||
| const double | dos_emax_ev, | ||
| const bool | dos_setemin, | ||
| const double | dos_emin_ev, | ||
| const bool | two_fermi, | ||
| const int | bndpar, | ||
| const std::string & | global_out_dir, | ||
| std::ofstream & | ofs_running ) |
calculate density of states(DOS), partial density of states(PDOS), and mulliken charge for LCAO base
|
inline |
Write the NPY v1 header for a one-dimensional array of structured records.
| void ModuleIO::write_dos_pw | ( | const UnitCell & | ucell, |
| const ModuleBase::matrix & | ekb, | ||
| const ModuleBase::matrix & | wg, | ||
| const K_Vectors & | kv, | ||
| const int | nbands, | ||
| const int | istep_in, | ||
| const elecstate::Efermi & | energy_fermi, | ||
| const double & | dos_edelta_ev, | ||
| const double & | dos_scale, | ||
| const double & | bcoeff, | ||
| const int | nspin, | ||
| const int | out_dos, | ||
| const bool | dos_setemax, | ||
| const double | dos_emax_ev, | ||
| const bool | dos_setemin, | ||
| const double | dos_emin_ev, | ||
| const bool | two_fermi, | ||
| const int | out_app_flag, | ||
| const int | precision, | ||
| const int | bndpar, | ||
| const std::string & | global_out_dir, | ||
| std::ofstream & | ofs_running ) |
calculate density of states(DOS) for PW base
| void ModuleIO::write_eband_terms | ( | const int | nspin, |
| const int | istep, | ||
| const int | out_app_flag, | ||
| const double | etot, | ||
| const int | my_rank, | ||
| const int | nbasis, | ||
| const Parallel_Orbitals * | pv, | ||
| const psi::Psi< TK > & | psi, | ||
| const UnitCell & | ucell, | ||
| Structure_Factor & | sf, | ||
| surchem & | solvent, | ||
| const ModulePW::PW_Basis & | rho_basis, | ||
| const ModulePW::PW_Basis & | rhod_basis, | ||
| const ModuleBase::matrix & | vloc, | ||
| const Charge & | chg, | ||
| const K_Vectors & | kv, | ||
| const ModuleBase::matrix & | wg, | ||
| Grid_Driver & | gd, | ||
| const std::vector< double > & | orb_cutoff, | ||
| const LCAO_Orbitals & | orb, | ||
| const TwoCenterBundle & | two_center_bundle, | ||
| std::ofstream & | ofs_running ) |
Write the band-decomposed energy of each Hamiltonian term (kinetic, local/nonlocal pp, Hartree) in KS orbital representation. The XC term is handled by write_Vxc from ctrl_scf_lcao.cpp instead.
| nspin | Number of spin components (1, 2 or 4) |
| istep | Zero-based ionic step index; written one-based in the header |
| out_app_flag | Output mode: 0 overwrites, 1 appends, 2 writes one numbered eband_*g{step}.txt file per written step |
| etot | Total energy of the current frame in Ry |
| my_rank | World rank; only rank 0 writes the files |
| TK | K-point data type (double or std::complex<double>) |
| TR | Real-space data type (double or std::complex<double>) |
| template void ModuleIO::write_eband_terms< double, double > | ( | const int | , |
| const int | , | ||
| const int | , | ||
| const double | , | ||
| const int | , | ||
| const int | , | ||
| const Parallel_Orbitals * | , | ||
| const psi::Psi< double > & | , | ||
| const UnitCell & | , | ||
| Structure_Factor & | , | ||
| surchem & | , | ||
| const ModulePW::PW_Basis & | , | ||
| const ModulePW::PW_Basis & | , | ||
| const ModuleBase::matrix & | , | ||
| const Charge & | , | ||
| const K_Vectors & | , | ||
| const ModuleBase::matrix & | , | ||
| Grid_Driver & | , | ||
| const std::vector< double > & | , | ||
| const LCAO_Orbitals & | , | ||
| const TwoCenterBundle & | , | ||
| std::ofstream & | ) |
| template void ModuleIO::write_eband_terms< std::complex< double >, double > | ( | const int | , |
| const int | , | ||
| const int | , | ||
| const double | , | ||
| const int | , | ||
| const int | , | ||
| const Parallel_Orbitals * | , | ||
| const psi::Psi< std::complex< double > > & | , | ||
| const UnitCell & | , | ||
| Structure_Factor & | , | ||
| surchem & | , | ||
| const ModulePW::PW_Basis & | , | ||
| const ModulePW::PW_Basis & | , | ||
| const ModuleBase::matrix & | , | ||
| const Charge & | , | ||
| const K_Vectors & | , | ||
| const ModuleBase::matrix & | , | ||
| Grid_Driver & | , | ||
| const std::vector< double > & | , | ||
| const LCAO_Orbitals & | , | ||
| const TwoCenterBundle & | , | ||
| std::ofstream & | ) |
| void ModuleIO::write_eig_file | ( | const ModuleBase::matrix & | ekb, |
| const ModuleBase::matrix & | wg, | ||
| const K_Vectors & | kv, | ||
| const int | nbands, | ||
| const int | nspin, | ||
| const std::string & | out_dir, | ||
| const int | istep, | ||
| const int | out_app_flag ) |
write eigenvalues and occupations to <out_dir>/eig_occ.txt
| nbands | number of bands requested by INPUT |
| nspin | number of spin channels |
| out_dir | directory the file is written into |
| istep | zero-based ionic step index; printed one-based and used for the g{step} filename suffix in out_app_flag mode 2 |
| out_app_flag | output mode: 0 overwrites, 1 appends, 2 writes one numbered file per written step |
| void ModuleIO::write_eig_iter | ( | const ModuleBase::matrix & | ekb, |
| const ModuleBase::matrix & | wg, | ||
| const K_Vectors & | kv, | ||
| const int | nbands, | ||
| const int | nspin ) |
print eigenvalues and occupations to the running log
| nbands | number of bands requested by INPUT |
| nspin | number of spin channels |
| void ModuleIO::write_elecstat_pot | ( | const int & | bz, |
| const int & | nbz, | ||
| const std::string & | fn, | ||
| const int & | istep, | ||
| ModulePW::PW_Basis * | rho_basis, | ||
| const Charge *const | chr, | ||
| const UnitCell * | ucell_, | ||
| const double * | v_eff_fixed, | ||
| const surchem & | solvent, | ||
| const std::vector< double > * | pcc_potential, | ||
| const std::vector< double > * | solvent_potential, | ||
| const int | precision, | ||
| const bool | append, | ||
| std::ofstream & | ofs_running ) |
write electric static potential to file
| bz | |
| nbz | |
| fn | |
| istep | |
| rho_basis | |
| chr | |
| ucell_ | |
| v_eff_fixed | |
| solvent | for solvation model |
| precision | output precision |
| append | append a frame to an existing cube file (out_app_flag == 1) |
Dipole correction
Add hartree potential and local pseudopot
Get the vacuum level of the system
Write down the electrostatic potential
| void ModuleIO::write_elf | ( | const std::string & | out_dir, |
| const int & | istep_in, | ||
| const int & | nspin, | ||
| const double *const * | rho, | ||
| const double *const * | tau, | ||
| ModulePW::PW_Basis *const | rho_basis, | ||
| const Parallel_Grid & | pgrid, | ||
| const UnitCell * | ucell_, | ||
| const int & | precision, | ||
| const std::string & | geom_block, | ||
| const bool | two_fermi, | ||
| const bool | append, | ||
| std::ofstream & | ofs_running ) |
| void ModuleIO::write_h_vh | ( | WriteHParams & | params | ) |
| void ModuleIO::write_h_vl | ( | WriteHParams & | params | ) |
| void ModuleIO::write_h_vnl | ( | WriteHParams & | params | ) |
| void ModuleIO::write_h_vxc | ( | WriteHParams & | params | ) |
| bool ModuleIO::write_hcontainer_csr | ( | const std::string & | fname, |
| const UnitCell * | ucell, | ||
| const int | precision, | ||
| hamilt::HContainer< TR > * | mat_serial, | ||
| const int | istep, | ||
| const bool | append, | ||
| const int | ispin, | ||
| const int | nspin, | ||
| const std::string & | label, | ||
| const std::string & | representation_note, | ||
| const double | efermi_eV, | ||
| const bool | has_efermi ) |
Write a single HContainer to CSR file with header.
| append | whether to append to an existing file; the first written step (istep <= 0) truncates |
| efermi_eV | the Fermi energy in eV for this spin channel |
| has_efermi | whether to append the Fermi energy to the spin-index line |
| void ModuleIO::write_hcontainer_csr_binary | ( | const std::string & | fname, |
| hamilt::HContainer< TR > * | mat_serial, | ||
| const int | istep, | ||
| const bool | append ) |
Write one HContainer record in the native binary CSR format.
| void ModuleIO::write_head | ( | std::ofstream & | ofs_running, |
| const int & | istep, | ||
| const int & | iter, | ||
| const std::string & | basisname ) |
write head for scf iteration
| ofs_running | output stream |
| istep | the ion step |
| iter | the scf iteration step |
| basisname | basis set name |
| void ModuleIO::write_head_td | ( | std::ofstream & | ofs_running, |
| const int & | istep, | ||
| const int & | estep, | ||
| const int & | iter, | ||
| const std::string & | basisname ) |
write head for scf iteration
| ofs_running | output stream |
| istep | the ion step |
| estep | the electron step |
| iter | the scf iteration step |
| basisname | basis set name |
| void ModuleIO::write_Hexxs_csr | ( | const std::string & | file_name, |
| const UnitCell & | ucell, | ||
| const std::vector< std::map< int, std::map< TAC, RI::Tensor< Tdata > > > > & | Hexxs ) |
write Hexxs in CSR format
| template void ModuleIO::write_Hexxs_csr< double > | ( | const std::string & | , |
| const UnitCell & | , | ||
| const std::vector< std::map< int, std::map< TAC, RI::Tensor< double > > > > & | ) |
| template void ModuleIO::write_Hexxs_csr< std::complex< double > > | ( | const std::string & | , |
| const UnitCell & | , | ||
| const std::vector< std::map< int, std::map< TAC, RI::Tensor< std::complex< double > > > > > & | ) |
| void ModuleIO::write_hsk | ( | const std::string & | global_out_dir, |
| const int | nspin, | ||
| const int | nks, | ||
| const int | nkstot, | ||
| const std::vector< int > & | ik2iktot, | ||
| const std::vector< int > & | isk, | ||
| hamilt::Hamilt< T > * | p_hamilt, | ||
| const Parallel_Orbitals & | pv, | ||
| const K_Vectors & | kv, | ||
| const UnitCell * | ucell, | ||
| const std::vector< double > & | efs, | ||
| const bool | gamma_only, | ||
| const int | out_app_flag, | ||
| const int | istep, | ||
| const int | out_type, | ||
| const int | precision, | ||
| const int | nlocal, | ||
| const std::string & | ks_solver, | ||
| const int | drank, | ||
| std::ofstream & | ofs_running ) |
Write H(k) and S(k) matrices for each k-point to disk.
Text output format is aligned with write_dmk: full metadata block (nspin, ik, k-point coords, weight, Fermi energy, basis count), followed by a UnitCell lattice block and then a flat matrix body (4 complex or 8 double values per line). Binary output continues to delegate to save_mat so its layout stays unchanged for callers that only consume binary files.
| kv | K-point container (coords, weights, counts). |
| ucell | Pointer to the UnitCell for the lattice block; may be nullptr if the caller cannot provide one. |
| efs | Fermi energies — one per spin channel. |
| void ModuleIO::write_hsr | ( | const std::vector< hamilt::HContainer< TR > * > & | hr_vec, |
| const hamilt::HContainer< TR > * | sr, | ||
| const UnitCell * | ucell, | ||
| const int | out_type, | ||
| const int | precision, | ||
| const Parallel_Blkcyclic & | paraV, | ||
| const int | out_app_flag, | ||
| const bool | gamma_only, | ||
| const int * | iat2iwt, | ||
| const int | nat, | ||
| const int | istep, | ||
| const std::string & | global_out_dir, | ||
| const elecstate::Efermi & | eferm, | ||
| std::ofstream & | ofs_running ) |
Write H(R) and S(R) in CSR format, unified with write_dmr interface.
| out_app_flag | output mode: 0 = fixed filename, overwritten; 1 = fixed filename, appended; 2 = per-step g{step} filename. |
|
inline |
Announce a written spin-resolved NAO-basis matrix file in the log.
| ofs_running | running log stream, open on the writing rank only. |
| property | name of the matrix, e.g. "DM(R)". |
| is | spin channel index. |
| nspin | number of spin channels; the label is empty unless nspin == 2. |
| file_name | path of the written file. |
|
inline |
Announce a written NAO-basis matrix file in the running log.
| ofs_running | running log stream, open on the writing rank only. |
| property | name of the matrix, e.g. "DM(k)" or "dS/dR (x component)". |
| file_name | path of the written file. |
|
inline |
Announce a spin-resolved output file in the running log.
| ofs_running | running log stream, open on the writing rank only. |
| property | name of the written quantity, e.g. "DOS". |
| is | spin channel index. |
| nspin | number of spin channels; the label is empty unless nspin == 2. |
| file_name | path of the written file. |
|
inline |
Announce a written output file in the running log.
All file-written notices share this single template so that the verb, the preposition and the spin label stay identical across writers: " Write <property><spin> to file: <file_name>".
| ofs_running | running log stream, open on the writing rank only. |
| property | name of the written quantity, e.g. "Charge density". |
| file_name | path of the written file. |
| void ModuleIO::write_orb_energy | ( | const K_Vectors & | kv, |
| const int | nspin0, | ||
| const int | nbands, | ||
| const std::vector< std::vector< double > > & | e_orb, | ||
| const std::string & | out_name, | ||
| const std::string & | header, | ||
| const std::string & | global_out_dir, | ||
| const bool | app = false ) |
Write orbital energies to file in LibRPA format.
| kv | K-point list |
| nspin0 | Number of independent spin channels (1 or 2) |
| nbands | Number of bands |
| e_orb | Orbital energies per k-point |
| out_name | Output file name relative to the output directory (e.g., "eband_vxc.txt", "eband_vl.txt") |
| header | Comment block written before the numeric data; empty to omit |
| global_out_dir | Output directory |
| app | Append mode flag |
| void ModuleIO::write_orb_info | ( | const UnitCell * | ucell, |
| std::ofstream & | ofs_running ) |
| void ModuleIO::write_pdos_npy | ( | const UnitCell & | cell, |
| const std::vector< ModuleBase::matrix > & | pdos, | ||
| int | nspin, | ||
| double | emin, | ||
| double | de, | ||
| const std::string & | path ) |
Write one NPY array of atom- and orbital-projected spin spectra.
| void ModuleIO::write_pdos_text | ( | const UnitCell & | ucell, |
| const ModuleBase::matrix * | pdos, | ||
| const int | nspin, | ||
| const int | nlocal, | ||
| const int | npoints, | ||
| const double & | emin, | ||
| const double & | dos_edelta_ev, | ||
| const std::string & | out_dir, | ||
| const int | istep, | ||
| const int | out_app_flag, | ||
| const int | precision, | ||
| std::ofstream & | ofs_running ) |
Write PDOS in plain text long-table format. File name: pdoss{spin}g{geom}.txt (g{geom} omitted when out_app_flag == 1) Columns: energy(eV) atom species l z m pdos(1/eV) For nspin=4, the two spinor components are summed.
| void ModuleIO::write_pot_init | ( | const UnitCell & | ucell, |
| const Parallel_Grid & | para_grid, | ||
| elecstate::ElecState * | pelec, | ||
| const int | istep, | ||
| const std::string & | out_dir, | ||
| const Input_para & | inp, | ||
| const bool | two_fermi, | ||
| std::ofstream & | ofs_running ) |
| void ModuleIO::write_proj_band_lcao | ( | const psi::Psi< TK > * | psi, |
| const Parallel_Orbitals & | pv, | ||
| const elecstate::ElecState * | pelec, | ||
| const K_Vectors & | kv, | ||
| const UnitCell & | ucell, | ||
| hamilt::Hamilt< TK > * | p_ham, | ||
| const int | istep, | ||
| const int | out_app_flag ) |
| ucell | Unit cell |
| p_ham | Hamiltonian used to build the projection overlaps |
| istep | Zero-based ionic step index; written one-based |
| out_app_flag | Output mode: 2 writes pbands{spin}g{step}.xml |
| void ModuleIO::write_td_field | ( | const elecstate::TDFieldManager & | manager, |
| const std::string & | output_dir ) |
Append the current electric-field samples to their output files. Times are written in fs with six decimal places, starting at physical time zero. Field components use scientific notation with twelve decimal places; columns are right-aligned.
| manager | Time-dependent electric-field state for the current electronic step. |
| output_dir | Output directory including its trailing path separator. |
| void ModuleIO::write_td_spin_pw | ( | const std::string & | directory, |
| int | step, | ||
| double | time_fs, | ||
| const std::vector< std::string > & | orbitals, | ||
| const std::string & | mag_partition, | ||
| const std::string & | orbital_dir, | ||
| double | onsite_radius, | ||
| bool | calc_torque, | ||
| bool | spin_current, | ||
| const pw::TDSpinResultPW & | spin, | ||
| const pw::TDVelResultPW & | current, | ||
| std::ostream & | log ) |
Write globally reduced endpoint data on the designated output rank only.
| step | Zero-based internal electronic step, written as step + 1. |
| time_fs | Physical time in fs, written with six decimal places; the initial state is at zero. |
| void ModuleIO::write_td_vecpot | ( | const std::string & | output_dir, |
| int | electronic_step, | ||
| const ModuleBase::Vector3< double > & | vector_pot ) |
Append one Cartesian vector-potential sample.
| output_dir | Output directory including its trailing path separator. |
| electronic_step | Zero-based electronic-step index. |
| vector_pot | Cartesian vector potential in atomic units. |
| void ModuleIO::write_vdata_palgrid | ( | const Parallel_Grid & | pgrid, |
| const double *const | data, | ||
| const int | is, | ||
| const int | nspin, | ||
| const int | iter, | ||
| const std::string & | fn, | ||
| const double | ef, | ||
| const UnitCell *const | ucell, | ||
| const int | precision, | ||
| const int | out_fermi, | ||
| const bool | two_fermi, | ||
| const bool | reduce_all_pool, | ||
| const bool | append, | ||
| std::ofstream & | ofs_running, | ||
| const std::string & | data_desc ) |
write volumetric data on the parallized grid into a .cube file
| append | append a complete frame to an existing cube file instead of truncating it. Used by out_app_flag == 1, where successive ionic steps reuse a fixed filename and each written step contributes one frame. |
output header for cube file
| void ModuleIO::write_Vxc | ( | const int | nspin, |
| const int | istep, | ||
| const double | etot, | ||
| const int | nbasis, | ||
| const int | drank, | ||
| const Parallel_Orbitals * | pv, | ||
| const psi::Psi< TK > & | psi, | ||
| const UnitCell & | ucell, | ||
| Structure_Factor & | sf, | ||
| surchem & | solvent, | ||
| const ModulePW::PW_Basis & | rho_basis, | ||
| const ModulePW::PW_Basis & | rhod_basis, | ||
| const ModuleBase::matrix & | vloc, | ||
| const Charge & | chg, | ||
| const K_Vectors & | kv, | ||
| const std::vector< double > & | orb_cutoff, | ||
| const ModuleBase::matrix & | wg, | ||
| Grid_Driver & | gd, | ||
| const bool | dft_plus_u, | ||
| const bool | gamma_only, | ||
| const bool | out_mat, | ||
| const int | out_app_flag, | ||
| const std::string & | mat_dir, | ||
| const std::string & | global_out_dir, | ||
| const int | out_ndigits, | ||
| const std::string & | ks_solver, | ||
| bool | cal_exx, | ||
| const Exx_Info & | exx_info, | ||
| std::ofstream & | ofs_running ) |
Write the Vxc matrix in KS orbital representation, useful for GW calculation including terms: local/semi-local XC, EXX, DFTU. The band-decomposed diagonal energies (eband_vxc.txt and, with EXX, eband_vxc_local.txt and eband_vxc_exx.txt) are always written to global_out_dir; the full MO-basis matrices (vxcmok*_nao.txt) are written to mat_dir only when out_mat is true. The MO-basis name keeps the "vxcmo" property so that it never collides with the NAO-basis "vxck*_nao.txt" produced by out_mat_vxck.
| istep | Zero-based ionic step index; written one-based in the header |
| out_app_flag | Output mode: 0 overwrites, 1 appends, 2 adds g{step} |
| etot | Total energy of the current frame in Ry |
| TK | K-point data type (double or std::complex<double>) |
| TR | Real-space data type (double or std::complex<double>) |
| template void ModuleIO::write_Vxc< double, double > | ( | const int | , |
| const int | , | ||
| const double | , | ||
| const int | , | ||
| const int | , | ||
| const Parallel_Orbitals * | , | ||
| const psi::Psi< double > & | , | ||
| const UnitCell & | , | ||
| Structure_Factor & | , | ||
| surchem & | , | ||
| const ModulePW::PW_Basis & | , | ||
| const ModulePW::PW_Basis & | , | ||
| const ModuleBase::matrix & | , | ||
| const Charge & | , | ||
| const K_Vectors & | , | ||
| const std::vector< double > & | , | ||
| const ModuleBase::matrix & | , | ||
| Grid_Driver & | , | ||
| const bool | , | ||
| const bool | , | ||
| const bool | , | ||
| const int | , | ||
| const std::string & | , | ||
| const std::string & | , | ||
| const int | , | ||
| const std::string & | , | ||
| bool | , | ||
| const Exx_Info & | , | ||
| std::ofstream & | ) |
| template void ModuleIO::write_Vxc< std::complex< double >, double > | ( | const int | , |
| const int | , | ||
| const double | , | ||
| const int | , | ||
| const int | , | ||
| const Parallel_Orbitals * | , | ||
| const psi::Psi< std::complex< double > > & | , | ||
| const UnitCell & | , | ||
| Structure_Factor & | , | ||
| surchem & | , | ||
| const ModulePW::PW_Basis & | , | ||
| const ModulePW::PW_Basis & | , | ||
| const ModuleBase::matrix & | , | ||
| const Charge & | , | ||
| const K_Vectors & | , | ||
| const std::vector< double > & | , | ||
| const ModuleBase::matrix & | , | ||
| Grid_Driver & | , | ||
| const bool | , | ||
| const bool | , | ||
| const bool | , | ||
| const int | , | ||
| const std::string & | , | ||
| const std::string & | , | ||
| const int | , | ||
| const std::string & | , | ||
| bool | , | ||
| const Exx_Info & | , | ||
| std::ofstream & | ) |
| void ModuleIO::write_Vxc_LIP | ( | int | nspin, |
| const int | istep, | ||
| const double | etot, | ||
| int | naos, | ||
| int | drank, | ||
| const psi::Psi< std::complex< FPTYPE > > & | psi_pw, | ||
| const UnitCell & | ucell, | ||
| Structure_Factor & | sf, | ||
| surchem & | solvent, | ||
| const ModulePW::PW_Basis_K & | wfc_basis, | ||
| const ModulePW::PW_Basis & | rho_basis, | ||
| const ModulePW::PW_Basis & | rhod_basis, | ||
| const ModuleBase::matrix & | vloc, | ||
| const Charge & | chg, | ||
| const K_Vectors & | kv, | ||
| const ModuleBase::matrix & | wg, | ||
| const bool | gamma_only, | ||
| const std::string & | global_out_dir, | ||
| const int | out_ndigits, | ||
| const std::string & | ks_solver, | ||
| bool | cal_exx, | ||
| double | hybrid_alpha ) |
Write the Vxc matrix in KS orbital representation for LIP (LCAO-in-PW), useful for GW calculation including terms: local/semi-local XC and EXX. The band-decomposed diagonal energies (eband_vxc.txt and, with EXX, eband_vxc_local.txt and eband_vxc_exx.txt) are written to global_out_dir.
| istep | Zero-based ionic step index; written one-based in the header |
| etot | Total energy of the current frame in Ry |
| FPTYPE | Floating point type (float or double) |
| template void ModuleIO::write_Vxc_LIP< double > | ( | int | , |
| const int | , | ||
| const double | , | ||
| int | , | ||
| int | , | ||
| const psi::Psi< std::complex< double > > & | , | ||
| const UnitCell & | , | ||
| Structure_Factor & | , | ||
| surchem & | , | ||
| const ModulePW::PW_Basis_K & | , | ||
| const ModulePW::PW_Basis & | , | ||
| const ModulePW::PW_Basis & | , | ||
| const ModuleBase::matrix & | , | ||
| const Charge & | , | ||
| const K_Vectors & | , | ||
| const ModuleBase::matrix & | , | ||
| const bool | , | ||
| const std::string & | , | ||
| const int | , | ||
| const std::string & | , | ||
| bool | , | ||
| double | ) |
| template void ModuleIO::write_Vxc_LIP< float > | ( | int | , |
| const int | , | ||
| const double | , | ||
| int | , | ||
| int | , | ||
| const psi::Psi< std::complex< float > > & | , | ||
| const UnitCell & | , | ||
| Structure_Factor & | , | ||
| surchem & | , | ||
| const ModulePW::PW_Basis_K & | , | ||
| const ModulePW::PW_Basis & | , | ||
| const ModulePW::PW_Basis & | , | ||
| const ModuleBase::matrix & | , | ||
| const Charge & | , | ||
| const K_Vectors & | , | ||
| const ModuleBase::matrix & | , | ||
| const bool | , | ||
| const std::string & | , | ||
| const int | , | ||
| const std::string & | , | ||
| bool | , | ||
| double | ) |
| void ModuleIO::write_Vxc_R | ( | const int | nspin, |
| const Parallel_Orbitals * | pv, | ||
| const UnitCell & | ucell, | ||
| Structure_Factor & | sf, | ||
| surchem & | solvent, | ||
| const ModulePW::PW_Basis & | rho_basis, | ||
| const ModulePW::PW_Basis & | rhod_basis, | ||
| const ModuleBase::matrix & | vloc, | ||
| const Charge & | chg, | ||
| const K_Vectors & | kv, | ||
| const std::vector< double > & | orb_cutoff, | ||
| Grid_Driver & | gd, | ||
| const std::string & | global_out_dir, | ||
| bool | cal_exx, | ||
| double | hybrid_alpha, | ||
| bool | real_number, | ||
| const int | istep, | ||
| const double | sparse_thr, | ||
| const int | precision, | ||
| std::ofstream & | ofs_running ) |
Write the Vxc matrix in real space (R), useful for GW calculation including terms: local/semi-local XC, EXX, DFTU The files are named vxcrs{spin}_nao.csr as a final-step snapshot; the spin index is one-based.
| TK | K-point data type (double or std::complex<double>) |
| TR | Real-space data type (double or std::complex<double>) |
| template void ModuleIO::write_Vxc_R< double, double > | ( | const int | , |
| const Parallel_Orbitals * | , | ||
| const UnitCell & | , | ||
| Structure_Factor & | , | ||
| surchem & | , | ||
| const ModulePW::PW_Basis & | , | ||
| const ModulePW::PW_Basis & | , | ||
| const ModuleBase::matrix & | , | ||
| const Charge & | , | ||
| const K_Vectors & | , | ||
| const std::vector< double > & | , | ||
| Grid_Driver & | , | ||
| const std::string & | , | ||
| bool | , | ||
| double | , | ||
| bool | , | ||
| const int | , | ||
| const double | , | ||
| const int | , | ||
| std::ofstream & | ) |
| template void ModuleIO::write_Vxc_R< std::complex< double >, double > | ( | const int | , |
| const Parallel_Orbitals * | , | ||
| const UnitCell & | , | ||
| Structure_Factor & | , | ||
| surchem & | , | ||
| const ModulePW::PW_Basis & | , | ||
| const ModulePW::PW_Basis & | , | ||
| const ModuleBase::matrix & | , | ||
| const Charge & | , | ||
| const K_Vectors & | , | ||
| const std::vector< double > & | , | ||
| Grid_Driver & | , | ||
| const std::string & | , | ||
| bool | , | ||
| double | , | ||
| bool | , | ||
| const int | , | ||
| const double | , | ||
| const int | , | ||
| std::ofstream & | ) |
| void ModuleIO::write_wfc_nao | ( | const int | out_type, |
| const int | out_app_flag, | ||
| const psi::Psi< T > & | psi, | ||
| const ModuleBase::matrix & | ekb, | ||
| const ModuleBase::matrix & | wg, | ||
| const std::vector< ModuleBase::Vector3< double > > & | kvec_c, | ||
| const std::vector< int > & | ik2iktot, | ||
| const int | nkstot, | ||
| const Parallel_Orbitals & | pv, | ||
| const int | nspin, | ||
| std::ofstream & | ofs_running, | ||
| const int | istep = -1 ) |
Writes the wavefunction coefficients for the LCAO method to a file. Will loop all k-points by psi.get_nk(). The nbands are determined by ekb.nc. The nlocal is determined by psi.get_nbasis() if not compiled with MPI, otherwise it is determined by pv->desc[2].
| out_type | The output file type. 1 for text, 2 for binary. |
| psi | The Psi object containing the wavefunction coefficients. |
| ekb | The matrix of Kohn-Sham eigenvalues. |
| wg | The matrix of Kohn-Sham eigenvectors. |
| kvec_c | The vector of k-points in Cartesian coordinates. |
| pv | The Parallel_Orbitals object containing additional information. |
| istep | The current step number. if < 0, the step number is not included in the file name. |
| template void ModuleIO::write_wfc_nao< double > | ( | const int | out_type, |
| const int | out_app_flag, | ||
| const psi::Psi< double > & | psi, | ||
| const ModuleBase::matrix & | ekb, | ||
| const ModuleBase::matrix & | wg, | ||
| const std::vector< ModuleBase::Vector3< double > > & | kvec_c, | ||
| const std::vector< int > & | ik2iktot, | ||
| const int | nkstot, | ||
| const Parallel_Orbitals & | pv, | ||
| const int | nspin, | ||
| std::ofstream & | ofs_running, | ||
| const int | istep ) |
| template void ModuleIO::write_wfc_nao< std::complex< double > > | ( | const int | out_type, |
| const int | out_app_flag, | ||
| const psi::Psi< std::complex< double > > & | psi, | ||
| const ModuleBase::matrix & | ekb, | ||
| const ModuleBase::matrix & | wg, | ||
| const std::vector< ModuleBase::Vector3< double > > & | kvec_c, | ||
| const std::vector< int > & | ik2iktot, | ||
| const int | nkstot, | ||
| const Parallel_Orbitals & | pv, | ||
| const int | nspin, | ||
| std::ofstream & | ofs_running, | ||
| const int | istep ) |
| void ModuleIO::write_wfc_pw | ( | const int | istep, |
| const int | iter, | ||
| const int | append_step, | ||
| const int | kpar, | ||
| const int | my_pool, | ||
| const int | my_rank, | ||
| const int | nbands, | ||
| const int | nspin, | ||
| const int | npol, | ||
| const int | rank_in_pool, | ||
| const int | nproc_in_pool, | ||
| const int | out_wfc_pw, | ||
| const int | out_app_flag, | ||
| const double & | ecutwfc, | ||
| const std::string & | global_out_dir, | ||
| const psi::Psi< std::complex< double > > & | psi, | ||
| const K_Vectors & | kv, | ||
| const ModulePW::PW_Basis_K * | wfcpw, | ||
| std::ofstream & | ofs_running ) |